in using WordPress + Astra When the theme creates a website, you don't want to show the default title (such as the post name or page name at the top of the page) in the front page.Astra provides two ways to hide the title:Setting through the interface respond in singing Batch processing using codeThe
![图片[1]-WordPress Astra 主题隐藏页面标题的两种方法](https://www.361sale.com/wp-content/uploads/2025/04/20250421143358618-image.png)
This article will describe the use of each of these two methods.
![图片[2]-WordPress Astra 主题隐藏页面标题的两种方法](https://www.361sale.com/wp-content/uploads/2025/04/20250421143504268-image.png)
Method 1: Use visual buttons to hide the title
Astra The theme has a built-in feature to visually hide headers, you can directly edit theweb pageTurn off the header display in without having to go into complicated theme settings or write code.
Operational Steps:
- log in WordPress the area behind a theatrical stage
- go into Pages > All PagesSelect the page where you want to hide the title, e.g. "About Us".
![图片[3]-WordPress Astra 主题隐藏页面标题的两种方法](https://www.361sale.com/wp-content/uploads/2025/04/20250421143601817-image.png)
- Mouse over the title area and an "eye icon" will appear.
![图片[4]-WordPress Astra 主题隐藏页面标题的两种方法](https://www.361sale.com/wp-content/uploads/2025/04/20250421143609116-image.png)
- Click on this icon to hide the title
- Click the "Update" button to save the settings and preview the frontend effect.
Effect Description:
- Before enabling: the top of the page will show the defaultcaptionsuch as "About Us"
![图片[5]-WordPress Astra 主题隐藏页面标题的两种方法](https://www.361sale.com/wp-content/uploads/2025/04/20250421143626546-image.png)
- When enabled: the title will not appear on the front of the page and the page structure will be cleaner
![图片[6]-WordPress Astra 主题隐藏页面标题的两种方法](https://www.361sale.com/wp-content/uploads/2025/04/20250421143632609-image.png)
If you need to do this for multiple pages, it is recommended to use the Astra Bulk Edit Plug-inIt allows you to batch edit the title display status of multiple pages at the same time to improve efficiency.
Need to redisplay the title? Simply click on the "eye icon" again to restore it.
Method 2: Hide titles site-wide through code (for developers)
If you wish to turn off all post or page titles uniformly, rather than setting them manually one by one, you can add the following code to the child theme's functions.php Documentation:
/**
* Hide title in specified article type
*/
function your_prefix_post_title() {
$post_types = array('page','post'); // Customizable post types for which titles need to be hidden
if ( ! in_array( get_post_type(), $post_types ) ) {
return; }
}
add_filter( 'astra_the_title_enabled', '__return_false' ); }
}
add_action( 'wp', 'your_prefix_post_title' ); }
Customized Description:
You can do this by modifying the $post_types = array(...) to determine which article types' titles need to be hidden. Example:
- Hide only all article titles:
array('post') - Hide all page titles only:
array('page') - Hide pages, articles & custom types at the same time:
array('page','post','custom-type-1')
Caveats:
- It is recommended that thesubthemeto avoid loss of customization code after the theme is updated.
- If you are not using a child theme, please refer to the above child theme link documentation to create one.
- It is recommended to back up your website before adding code to ensure security
summarize
Astra Provides a flexible way for you to control whether the page title is displayed or not, whether it is set on a separate page or the whole site uniformly hidden, can be achieved through simple operation or code. For pages that only need to hide titles occasionally, use the "eye icon" approach is more intuitive; while users who wish to batch process are recommended to use the code approach with child theme management.
Link to this article:https://www.361sale.com/en/51036/The article is copyrighted and must be reproduced with attribution.


















![表情[wozuimei]-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/themes/zibll/img/smilies/wozuimei.gif)
![表情[baoquan]-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/themes/zibll/img/smilies/baoquan.gif)

No comments