Answer the question
In order to leave comments, you need to log in
WP YOAST SEO stubbornly adds to the title of the pages Site title, how to remove it?
If someone has the same problem - check in header.php output Title? in my case it was
<title><?php bloginfo('name'); ?><? wp_title(':'); ?></title>
- I replaced it with <title><?php wp_title("", true); ?></title>
(although wp_title is outdated for current versions) Answer the question
In order to leave comments, you need to log in
Alternatively, remove the entire line from header.php
Then in function.php add title generation support:
function setup_theme() {
add_theme_support( 'title-tag' );
}
add_action( 'after_setup_theme', 'setup_theme' );
add_filter( 'document_title_parts', 'mytheme_remove_title' );
function mytheme_remove_title( $title ){
if ( !is_home() ) {
$title['site'] = '';
}
return $title;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question