Title of wordpress post can be removed using the_title filter for a category, single post or page or all pages / posts. Following code will remove title of posts in wordpress category. Place the code to the end of functions.php file of active theme of your website.
function remove_title_of_category( $title, $id = null ) {
if( is_single() ) { /* this will remove title of post/page on single page and not from list of posts */
if ( in_category('wordpress', $id ) ) {
return false;
}
}
return $title;
}
add_filter( 'the_title', 'remove_title_of_category', 10, 2 );
Hide / Remove post title using CSS
We can hide post title using display property of element which contains the title of page.
- Visit a page / post using Chrome or you favorite web browser.
- Right Click on its heading / title text.
- Click on inspect.
- You will see HTML source of title / heading element.
- There will be an attribute class for this element. Note down its value e.g. entry-title
- Login into admin dashboard of you site.
- Go to Appearance->Theme Editor.
- Select the file style.css from files list given on right side bar
- Go to end of style.css and place following code at the end:
.entry-title{
display:none !important;
}