Removing rel canonical added by Yoast SEO plugin

前端 未结 5 911
难免孤独
难免孤独 2020-12-19 00:09

Couldn\'t find a solution after a quick google so thought i\'d pop a quick post on here.

Trying to remove a automatically added rel=canonical link (which is added by

5条回答
  •  伪装坚强ぢ
    2020-12-19 00:45

    rel="canonical" has nothing to do with crawling. It has to do with indexing and prevents the same page from indexing twice or more.

    Anyway, if you still want to do this you can do it by adding this code to your functions.php:

    add_filter( 'wpseo_canonical', '__return_false' );
    

    Source: https://yoast.com/wordpress/plugins/seo/api/

提交回复
热议问题