WordPress的删除机器人元标记noindex [英] Wordpress remove Robots Meta Tag noindex

查看:690
本文介绍了WordPress的删除机器人元标记noindex的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

遇到一个wordpress站点meta机器人标签的奇怪问题.所有页面都有以下meta标记,我们似乎无法将其删除

were experiencing a strange issue with a wordpress sites meta robots tag. All pages have the following meta tag and we cant seem to remove it

<meta name="robots" content="noindex,follow"/>

我们在设置">阅读">搜索引擎可见性"中未选中阻止搜索引擎对该网站建立索引",但是它什么也没做.

We have unchecked "Discourage search engines from indexing this site" in Settings > Reading > Search Engine Visibility but it does nothing.

我们正在使用Yoast SEO插件,但是即使禁用了它,它仍然存在.实际上,我们尝试禁用所有插件以检查是否有任何干扰.

We are using the Yoast SEO plugin but even when this is disabled the still remains. In fact, we have tried disabling all plugins to check nothing was interfering with it.

我们已经如下设置了Robots.txt文件:

We have setup our Robots.txt file as follows:

User-agent: *
Disallow: 
Sitemap: http://speysidedistillery.co.uk/sitemap.xml

我不确定Robots.txt是否优先于robots meta标签,并且似乎没有确定的答案,据我所知,限制性最高的答案将优先于我.元标记.

Im not sure if the Robots.txt takes precedent over the robots meta tag or not and there doesn't seem to be a definitive answer, as far as i can gather the most restrictive one will take precedent i.e in our case the meta tag.

这主要是给我们的Google列表问题,而不是我们的网站描述出现警告由于该网站的robots.txt,此结果的描述不可用".

This is mainly giving us issues with our google listing with the warning "A description for this result is not available because of this site's robots.txt" appearing instead of our sites description.

如果情况变得更糟,我们可以在wp-includes/general-templates.php中编辑wp_no_robots函数,但希望在不编辑wp核心文件的情况下解决此问题.

If worse comes to worst we can edit the wp_no_robots function in wp-includes/general-templates.php but would prefer to resolve this without editing the wp core files.

任何光亮的人都可以照亮,这很高兴,因为我们不知所措,欢呼

Any light anyone could shone on this would be great as we are at a loss, cheers

可以在 http://speysideistillery.co.uk/

推荐答案

我找到了一个对我有用的解决方案

I found a solution that worked for me here

add_action( 'init', 'remove_wc_page_noindex' );
function remove_wc_page_noindex() {
    remove_action( 'wp_head', 'wc_page_noindex' );
}

这个问题似乎来自三个主题:

This question appears to be on three threads:

  1. 如何阻止Wordpress插入一个noindex元标记?
  2. WordPress删除机器人元标记noindex
  3. 无法在wordpress中删除操作noindex
  1. How do I stop Wordpress from inserting a noindex meta tag?
  2. Wordpress remove Robots Meta Tag noindex
  3. Cannot remove action noindex in wordpress

这篇关于WordPress的删除机器人元标记noindex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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