• Resolved Wayne

    (@waynep16)


    When someone migrated our site it left hundreds of incorrect canonical links hard set on all pages

    eg – https://i.snipboard.io/1mo3wO.jpg

    I have tried the Yoat tool to clear migration indexes but these values still persist.

    Do you have an easy way/function/query I can use to mass REMOVE all canonical link meta data that is now stuck on all pages?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello Wayne,

    Thanks for reaching out regarding your canonical URLs. I understand that you want to update the canonical URLs for your posts in bulk. Unfortunately, the Yoast SEO plugin does not have the option to achieve this yet. There is only the option to edit per page or post.

    However, you can add custom code using the provided Yoast hooks and APIs to output the desired canonical URL automatically for your website. We have more details about changing the canonical URLs in the developer documentation here: https://developer.yoast.com/features/seo-tags/canonical-urls/api/.

    Thread Starter Wayne

    (@waynep16)

    We want to delete all, is there a way in your API to clear / delete ALL canonical?

    Plugin Support Maybellyne

    (@maybellyne)

    Hello,

    If you want, you can also filter the output of the canonical programmatically. To do this, you can use the wpseo_canonical filter. If you return false on that, no canonical will be output. Some examples can be found here.

    Do ensure to test this on a staging site, first.

    Plugin Support devnihil

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove all custom canonicals from DB’ is closed to new replies.