HTTP/2 301
server: nginx
date: Thu, 09 Oct 2025 18:02:31 GMT
content-type: text/html; charset=UTF-8
x-olaf: ⛄
vary: accept, content-type
x-redirect-by: WordPress
location: https://developer.wordpress.org/reference/hooks/document_title_parts/
x-frame-options: SAMEORIGIN
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
HTTP/2 200
server: nginx
date: Thu, 09 Oct 2025 18:02:31 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
vary: accept, content-type
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
document_title_parts – Hook | Developer.WordPress.org
apply_filters( ‘document_title_parts’, array $title )
Filters the parts of the document title.
$title
arrayThe document title parts.
title
stringTitle of the viewed page.
page
stringOptional. Page number if paginated.
tagline
stringOptional. Site description when on home page.
site
stringOptional. Site title when not on home page.
Version | Description |
---|
4.4.0 | Introduced. |
Change the title for a specific page ID:
Make sure your add_filter() comes before the get_header() in your template file if you adding a title filter for that template file.
add_filter
in your template file. These kind of calls should live in your theme’sfunctions.php
file instead.