删除 Yoast SEO 插件添加的 rel 规范 [英] Removing rel canonical added by Yoast SEO plugin

查看:17
本文介绍了删除 Yoast SEO 插件添加的 rel 规范的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在快速谷歌之后找不到解决方案,所以我想我会在这里快速发布一个帖子.

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

尝试删除自动添加的 rel=canonical 链接(由 Wordpress SEO 插件 - Yoast 添加).

Trying to remove a automatically added rel=canonical link (which is added by Wordpress SEO plugin - by Yoast).

我实际上希望谷歌抓取每个不同的子页面,即使它可能不会离开父页面.

I actually want google to crawl each of the different subs even though it may not move away from the parent page.

推荐答案

rel="canonical" 与抓取无关.它与索引有关,并防止同一页面被索引两次或更多次.

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

无论如何,如果您仍然想这样做,您可以通过将此代码添加到您的functions.php中来实现:

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' );

来源:https://yoast.com/wordpress/plugins/seo/api/

这篇关于删除 Yoast SEO 插件添加的 rel 规范的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆