add_filter( 'document_title', function( $title ) { if ( is_singular() ) { $title = str_replace( ' | ', '', $title ); } return $title; });