I have this code:

 <h1><?php the_title(); ?></h1>

That is meant to display the title of my blog post only. But because Yoast has a SEO title of something else, it is displaying that title on the page instead of the_title() eg:

It should be:

This is a title

And not what Yoast is doing:

This is a title - my site name

  • 1
    That's not what the SEO title does/is for. Are you sure you haven't used wp_title() in your template by mistake? – Jacob Peattie Jul 16 '19 at 9:37
  • Ah, yeah. I was pulling in the wrong template which was wp_title(). Thanks! – user8463989 Jul 16 '19 at 9:40

That's not what the SEO title does/is for. It appears that you've used the wp_title() function in your template by mistake.

wp_title() is intended for use in the <title> tag in the <head> for setting the browser tab/document title. However, since WordPress 4.1 this has been superseded (but not officially deprecated, yet) by add_theme_support( 'title-tag' ), so these days wp_title() really shouldn't be used.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.