• Resolved mdotk

    (@mdotk)


    FYI I got notified of AMP errors today by Search Console (multiple canoncials). I found out that YOAST was adding in second canonical. This code fixes it:

    // remove yoast canonical for web stories
    function remove_canonical() {
        if ( is_singular( 'web-story' ) ) {
            add_filter( 'wpseo_canonical', '__return_false' );
        }
    }
    add_action('wp', 'remove_canonical');
    • This topic was modified 3 years, 5 months ago by mdotk.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thanks for letting us know, @mdotk, and thanks for sharing that solution.

    This issue was already reported to Yoast via GitHub by another user here, so I’ve added a note there as well so that Yoast can fix this issue in a future release. Please follow that issue for future updates.

    Feel free to open a new support topic if you have any other questions. Thank you!

    Hello,

    where do you put this piece of code exactly?

    Thank you!

    @sophieauffret You can add this to your site’s functions.php file. It’s best to access this via FTP, but if you cannot, you can also edit it directly in the WordPress admin by going to Appearance > Theme Editor and selecting Theme Functions (functions.php) in the right sidebar. Scroll all the way down and paste the code above at the bottom, then click Update File.

    Note that this is manually editing your theme’s code, so please be careful when editing as inadvertent changes can cause your site not to work.

    @sophieauffret @mdotk Web Stories has released version 1.12.0, which should resolve the compatibility issue with Yoast:?https://github.com/Yoast/wordpress-seo/issues/17419.

    Please update to the latest version of Web Stories, safely remove the mini-plugin and the temporary workaround code in your functions.php file. Then, confirm the issue is resolved on your end as well. Feel free to open a new support topic if you continue to encounter issues, or reopen this topic and we’d be happy to assist. Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Multiple Canonicals’ is closed to new replies.