Head & Meta Hooks: The Silent Failures WordPress Won’t Warn You About
These five hooks control what WordPress writes into <title>, into <head>, into the <body> class list, and right before </body>. On paper, plumbing. In practice, this is exactly…

Filter Hook since 0.71
Filters 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.
When wp_title() is called directly by a theme's header.php. Block/modern themes usually use document_title_parts instead.
apply_filters( 'wp_title', string $title, string $sep, string $seplocation );$title string — Title text.$sep string — Separator.$seplocation string — left or right.add_filter( 'wp_title', function( $title, $sep ) {
return $title . $sep . get_bloginfo( 'name' );
}, 10, 2 );Append the site name to the classic title output.
add_filter( 'wp_title', function( $title, $sep, $seplocation ) {
if ( is_feed() ) {
return $title;
}
return 'left' === $seplocation ? get_bloginfo( 'name' ) . " $sep $title" : $title;
}, 10, 3 );Skip the filter for feeds and control separator placement manually.

These five hooks control what WordPress writes into <title>, into <head>, into the <body> class list, and right before </body>. On paper, plumbing. In practice, this is exactly…
The wp_title() template tag is legacy — modern themes render titles via wp_get_document_title() and the document_title_parts filter. wp_title only fires if a theme still calls wp_title() directly in header.php.
Source: wp-includes/general-template.php
One session: this hook, then each related_hooks entry. Walk it and tell us what to change.
wp_title → the_title → document_title_parts
Practice the wp_title WordPress filter hook in our interactive sandbox — a VS Code-style editor with a step-by-step wp_title tutorial, add_filter exercises, and instant feedback. No local WordPress install required.