How to hide page titles with the Astra theme

astra theme templates

It is increasingly common to hide the title of the pages when you are designing a website with WordPress, mainly because we design using blocks of content and usually the title of the page is outside the design, which makes it a bit pointless to show.

page title shown

Any modern WordPress theme should allow not to display the page title at will, precisely to avoid such design disasters.

Astra is a good example of a WordPress theme with everything a good theme should have nowadays.

How to hide the title on specific pages

As I said, it is important that the WordPress theme allows you to hide the title at will on those pages that do not need it, in which it is an annoying element, discordant with the design.

I’m referring especially to pages with full screen layouts, created with blocks, a layout like Divi or Elementor, etc..

With Divi, for example, you don’t have to do anything, once you activate the Divi builder it will automatically not show any common element of the page, such as the title, it will only show the sections, rows and modules that you add.

But with the themes that do not include layout you must look for a specific setting, like the one you have in Astra.

disable page title setting with Astra

Once you check the box to deactivate the title and save the changes, it will no longer be displayed on your page.

Page with title disabled with Astra

The only thing that is displayed is what you have created with blocks, you have all the control.

But what if I don’t want any page to have a title?

How to hide the title on all pages

If you don’t want any page of your website to have a title, because you always design them with blocks, there is no global setting in Astra that allows you to disable them on all pages.

But you can apply a filter to achieve this:

/* Disable page titles in Astra */ function wphelp_no_page_title() { $post_types = array('page'); if ( ! in_array( get_post_type(), $post_types ) ) { return; } add_filter( 'astra_the_title_enabled', '__return_false' ); } add_action( 'wp', 'wphelp_no_page_title' );
Code language: PHP (php)

Just add the above code to the end of the functions.php file of your Astra child theme or in your customizations plugin and save the changes.

It will automatically stop displaying titles on all your pages.

If you want it to also apply to posts or other content type, then add – separated by commas – the content type to the array. For example, to also hide the title on posts:

$post_types = array('page,post');
Code language: PHP (php)

I hope I’ve helped you discover a fantastic functionality of the Astra theme, currently the best free theme out there, and also one of the best premium themes you can use for any type of website.

Click to rate this post!
[Total: 0 Average: 0]

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top Skip to content