Fixing missing add_theme_support in your theme

Since WordPress 4.1, you have to used add_theme_support(‘title-tag’); in your functions.php of your theme to display the meta title correctly.

First, open your header.php file and check if <title><?php wp_title(); ?> is present.

If it’s true, remove this line.

Then, go to your functions.php and add this snippet:

function seopress_theme_slug_setup() {
    add_theme_support( 'title-tag' );
}
add_action( 'after_setup_theme', 'seopress_theme_slug_setup' );

This, is the correct way to display your meta title in WordPress since 2015! Learn more on WordPress Official Blog.


Last modified: August 12, 2018