Home › Forums › Back End › WordPress – modify title tag. › Reply To: WordPress – modify title tag.
June 6, 2016 at 11:41 pm
#242594
Ilan Firsov
Participant
This looks to be working:
<?php
add_filter( 'pre_get_document_title', 'my_404_title' );
function my_404_title( $title ) {
if( is_404() ) {
return 'new 404 page title';
}
return $title;
}