• Resolved Urbansoul Design

    (@urbansoul-design)


    Hi. We are creating a new block theme for a client, but WordPress and Yoast are both producing the exact same title meta tag on every page. I believe this is due to WordPress changing they way they display title tags and removing the conditional title tag rendering and instead making it unconditional. You can see this in their wp-includes/block-template.php where they add the action “_block_template_render_title_tag”.

    We’ve checked back on a few sites using block themes and this is the case on all of them.

    As wordpress are forcing this into the <head> of the page, is there any way you can make your code check if _block_template_render_title_tag exists and then not show your title tag? I’m assuming this is more possible than getting wordPress to change their methodology as they changed this when they introduced block themes.

    Sorry if I have rambled on a bit, but we’ve had an SEO company flag this as a big issue so need to do something other than using jQuery to remove the second title tag.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Urbansoul Design

    (@urbansoul-design)

    Thanks!!

    Plugin Support Maybellyne

    (@maybellyne)

    Hello @urbansoul-design

    Thanks for reaching out about the <title> tag. If your theme is compatible with WordPress 4.1 and newer versions, it should declare theme support for the?title-tag?and remove all?<title>?calls from theme files to support dynamic titles. Please check this help article for some pointers.

    Thread Starter Urbansoul Design

    (@urbansoul-design)

    Hi Maybellyne.

    Thanks for getting back to me. Yes, we already declared support, as we have for years. However, you got me thinking about that, so I removed the line declaring title tag support and now your title tag is no longer showing, just the one WP now forces you to have.

    Remember, this is a block theme, not an old style theme with all the php files. But at least the duplication is removed and maybe someone else will see this post and find it useful.

    Thanks again for getting back to me.

    Mark

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Multiple title tag in block theme’ is closed to new replies.