Hestia Pro - Hide/remove page titles and metadata
This article will help you hide the titles and metadata ("Published by") in your posts and/or pages when using Hestia Pro.
Removing Metadata |
Removing Title |
Removing Metadata
- Remove both the "By author on date" metadata from the Blog page and the "Published by author on date" metadata from Single posts.
-
Default metadata on single post layout
Keep the date only
This can be achieved by adding the following code at the end of the functions.php child file of the child theme. For more information on how to create a child theme for Hestia Pro, please check this guide.
function get_time_tags_duplicate() { $time = ''; $time .= '<time class="entry-date published" datetime="' . esc_attr( get_the_date( 'c' ) ) . '" content="' . esc_attr( get_the_date( 'Y-m-d' ) ) . '">'; $time .= esc_html( get_the_time( get_option( 'date_format' ) ) ); $time .= '</time>'; if ( get_the_time( 'U' ) === get_the_modified_time( 'U' ) ) { return $time; } $time .= '<time class="updated hestia-hidden" datetime="' . esc_attr( get_the_modified_date( 'c' ) ) . '">'; $time .= esc_html( get_the_time( get_option( 'date_format' ) ) ); $time .= '</time>'; return $time; } function remove_the_author_from_post_metadata() { $output = sprintf( /* translators: %1$s is the date*/ esc_html__( 'Published on %1$s', 'hestia-pro' ), get_time_tags_duplicate() ); return $output; } add_filter( 'hestia_single_post_meta', 'remove_the_author_from_post_metadata' );
Add the following code to Appearance > Customize > Additional CSS:
.single-post .hestia-title + .author { display: none; }
Add the following code to Appearance > Customize > Additional CSS:
.author { display: none; }
📝 Note: The CSS code only hides the titles and does not remove them from the page content. That said, the text will still be available to search engines. If you do not want them to appear in search engines, you can also try to remove them by using a child theme and removing them through custom PHP code.
Hestia also has these Header layout designs available, which can be changed page-specific.
Removing Title
📝 Note: Please note that the below behavior can be achieved by using the built-in "Disable Title" option of Hestia. Read more about this here.
- Remove the page title from the pages. This applies only if you are using the Default Template.
Add the following code to Appearance > Customize > Additional CSS:
.page-template-default:not(.home) .hestia-title { display: none; }
- Remove page title from single pages:
Add the following code to Appearance > Customize > Additional CSS:
body:not(.home):not(.single-post) .hestia-title { display: none; }
Remove the page title for the second and third header layout
body:not(.home):not(.single-post) .hestia-title.title-in-content { display: none; }
- Remove the post title on Post pages:
Add the following code to Appearance > Customize > Additional CSS:
.single-post:not(.home) .hestia-title { display: none; }
-
Remove the title on a specific page by adding the following code to Appearance > Customize > Additional CSS; make sure you replace the ID number with that of the page you want to hide it from:
.page-template-default.page-id-139 .hestia-title { display: none; }
-
Remove the title on a specific post by adding the following code to Appearance > Customize > Additional CSS; make sure you replace the ID number with that of the post you want to hide it from. The post ID can be found while you edit a post:
.post-template-default.postid-1 .hestia-title { display: none; }
Check also how to remove the metadata under the title in case you want to remove also that along with the title.