Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress – modify title tag. Reply To: WordPress – modify title tag.

#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;
}