wp_title
head-metaFilters the document <title> tag
wp_title is the classic document-title filter. Modern themes should prefer document_title_parts — this hook remains for older title tags.
Signature
apply_filters( 'wp_title', string $title, string $sep, string $seplocation );Example
add_filter( 'wp_title', function( $title, $sep ) {
return $title . $sep . get_bloginfo( 'name' );
}, 10, 2 );Common Use Cases
- Customize SEO page titles on legacy themes
- Append site name to titles
- Set title format for specific pages
- Override title for 404 pages

