Title: Multiple Canonicals
Last modified: September 9, 2021

---

# Multiple Canonicals

 *  Resolved [mdotk](https://wordpress.org/support/users/mdotk/)
 * (@mdotk)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/multiple-canonicals/)
 * 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 4 years, 8 months ago by [mdotk](https://wordpress.org/support/users/mdotk/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Bethany Chobanian Lang](https://wordpress.org/support/users/mxbclang/)
 * (@mxbclang)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/multiple-canonicals/#post-14858874)
 * Thanks for letting us know, [@mdotk](https://wordpress.org/support/users/mdotk/),
   and thanks for sharing that solution.
 * This issue was already reported to Yoast [via GitHub by another user here](https://github.com/Yoast/wordpress-seo/issues/17419),
   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!
 *  [sophieauffret](https://wordpress.org/support/users/sophieauffret/)
 * (@sophieauffret)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/multiple-canonicals/#post-14859619)
 * Hello,
 * where do you put this piece of code exactly?
 * Thank you!
 *  [Bethany Chobanian Lang](https://wordpress.org/support/users/mxbclang/)
 * (@mxbclang)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/multiple-canonicals/#post-14859646)
 * [@sophieauffret](https://wordpress.org/support/users/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.
 *  [Luckyna San](https://wordpress.org/support/users/luckynasan/)
 * (@luckynasan)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/multiple-canonicals/#post-14944582)
 * [@sophieauffret](https://wordpress.org/support/users/sophieauffret/) [@mdotk](https://wordpress.org/support/users/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](https://wordpress.org/support/plugin/web-stories/#new-post)
   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.

 * ![](https://ps.w.org/web-stories/assets/icon.svg?rev=2386543)
 * [Web Stories](https://wordpress.org/plugins/web-stories/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/web-stories/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/web-stories/)
 * [Active Topics](https://wordpress.org/support/plugin/web-stories/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/web-stories/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/web-stories/reviews/)

 * 4 replies
 * 4 participants
 * Last reply from: [Luckyna San](https://wordpress.org/support/users/luckynasan/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/multiple-canonicals/#post-14944582)
 * Status: resolved