# Custom Title for the Homepage

> Sets the browser and search result title of the homepage to the exact text you choose instead of "Site Name - Tagline".

- Type: PHP
- Runs: Run everywhere
- Category: [SEO](https://wpide.com/library/category/seo/)
- Tags: title, homepage, branding
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/custom-homepage-title/

## Code

```php
// Full title used on the homepage.
$wpide_homepage_title = 'Acme Studio | Web Design and Branding in Lisbon';

add_filter( 'pre_get_document_title', function ( $title ) use ( $wpide_homepage_title ) {
    if ( is_front_page() && '' !== trim( $wpide_homepage_title ) ) {
        return $wpide_homepage_title;
    }

    return $title;
} );
```

## Notes

Skip this if an SEO plugin already manages your homepage title.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Custom Title for the Homepage" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
