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 4.4.0
Filters the parts that build the <title> tag on modern themes
document_title_parts is the modern replacement for wp_title — it works with an array of parts, not a raw string, so you edit pieces instead of parsing text.
Inside wp_get_document_title(), called from _wp_render_title_tag() on wp_head with priority 1.
apply_filters( 'document_title_parts', array $title );$title array — Associative array with keys like title, page, tagline, site.add_filter( 'document_title_parts', function( $title ) {
if ( is_singular( 'book' ) ) {
$title['title'] .= ' | Book Review';
}
return $title;
} );Append a label to the title on a single custom post type view.

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…
Modern themes render the title via wp_get_document_title(), which uses document_title_parts — wp_title() usually isn't called at all.
Source: wp-includes/general-template.php
One session: this hook, then each related_hooks entry. Walk it and tell us what to change.
document_title_parts → wp_title
Practice the document_title_parts WordPress filter hook in our interactive sandbox — a VS Code-style editor with a step-by-step document_title_parts tutorial, add_filter exercises, and instant feedback. No local WordPress install required.