Skip to content Skip to navigation
Back to the main support

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 file of your child theme (or your theme if you don’t have one) 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.