If you’re using the popular Astra theme in WordPress and want to display a different site title on a specific page—such as customizing the header for an “About” or “Landing” page—you can easily achieve this by adding a few lines of code to your theme’s functions.php file.
Why Customize the Site Title?
Tailoring the site title for specific pages can help:
- Improve SEO by using more targeted page titles
- Offer a personalized experience to visitors
- Support marketing campaigns with page-specific branding
Step-by-Step: Change Astra’s Site Title on One Page
- Open your WordPress dashboard
- Go to Appearance > Theme File Editor
- Locate and open the functions.php file in your child theme (always recommended to use a child theme)
- Add the following code:
function custom_astra_site_title_change( $title ) {
if ( is_page( 'about' ) ) { // Replace 'about' with your page slug or ID
$title = 'Custom Title for About Page';
}
return $title;
}
add_filter( 'astra_site_title', 'custom_astra_site_title_change' );
Optional: Change the Tagline Too
To customize the site tagline (the subtitle below the site title), you can use:
function custom_astra_site_tagline_change( $tagline ) {
if ( is_page( 'about' ) ) {
$tagline = 'Your custom tagline here';
}
return $tagline;
}
add_filter( 'astra_site_tagline', 'custom_astra_site_tagline_change' );
What If You Want to Change the Browser Tab Title Too?
The browser title is controlled separately. You can override it with:
function custom_document_title_parts( $title ) {
if ( is_page( 'about' ) ) {
$title['title'] = 'Custom Browser Tab Title';
}
return $title;
}
add_filter( 'document_title_parts', 'custom_document_title_parts' );
Final Notes
- Always use a child theme for code changes.
- Backup your site before modifying core files.
- This method works seamlessly with Astra’s header system without touching the template files directly.
By using WordPress filters, you can smartly adjust your site’s appearance based on context—without breaking theme updates or overriding complex templates.