Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

Blank Canvas: Duplicate title tags when using Yoast SEO #69286

Closed pauljacobson closed 2 years ago

pauljacobson commented 2 years ago

Quick summary

Our customer reported that they have duplicate <title> tags in their site's metadata. The site uses the Blank Canvas theme and has both Yoast SEO and Yoast Premium plugins installed. This is what the user sees in their site metadata:

Capture_2022-10-20 at 15 49 28@2x

We recommended the suggested workaround in the similar Blockbase: Duplicate Title tag on all blockbase & blockbase-premium themes · Issue #5702 · Automattic/themes issue but this doesn't seem to work in this case.

Bear in mind that the site uses other plugins, including Elementor.

Steps to reproduce

  1. If you load the site with Yoast SEO active on the site and with the site using Blank Canvas, the customer sees the duplicate title tags as I demonstrated above.
  2. If I deactivate Yoast SEO then the title tag changes from the custom <title>Marketing</title> tag to <title>our services – New Edge Media Group</title> based on the site's title (this is when on the homepage), and the duplicate title tag is removed.
  3. I have also tested this issue on a test site, here: https://atomicpljcbsn.blog where I have Blank Canvas installed, along with the Yoast SEO plugin. There is no duplicate title tag on my test site in this configuration.

What you expected to happen

If this issue is the same as the one reported in Blockbase: Duplicate Title tag on all blockbase & blockbase-premium themes · Issue #5702 · Automattic/themes then using the suggested code, below, should remove the duplicate title tag.

Here is the code we added to the site, and that doesn't seem to have resolved the issue:

function blockbase_remove_duplicate_title_tag_nrmn () {

    if (  ! wp_is_block_theme() ) {
        return;
    }   

    remove_theme_support( 'title-tag' );    
}

add_action( 'after_setup_theme', 'blockbase_remove_duplicate_title_tag_nrmn', 10 );

What actually happened

There are duplicate title tags that seem to be added when Yoast SEO is activated on the site.

Context

The customer reported this issue in 37472111-hc and 5644577-zen

Platform (Simple, Atomic, or both?)

Atomic

Theme-specific issue?

No response

Browser, operating system and other notes

This doesn't seem to be dependent on operating system or browser.

Reproducibility

Once

Severity

Some (< 50%)

Available workarounds?

No but the platform is still usable

Workaround details

The proposed workaround doesn't seem to be working.

github-actions[bot] commented 2 years ago

Support References

This comment is automatically generated. Please do not edit it.

jamiepalatnik commented 2 years ago

📌 SCRUBBING : RESULT

📌 FINDINGS/SCREENSHOTS/VIDEO