admin管理员组文章数量:1122832
I have just received an email from Google advising that it can't accessing certain javascript and css content from my site.
I've looked at the robots.txt file which contains:
User-agent: * Crawl-delay: 5
Disallow: /feed/
Disallow: /trackback/
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /xmlrpc.php
Disallow: /wp-*
It looks like it is the Disallow: /wp-*
that is doing the damage.
I am just going through the process of disabling each plugin in turn to see which one (if any) is causing this line to appear in the robots.txt file, but could there be another reason for it (e.g., core WordPress feature/setting)?
And is it fine and safe for me to just remove this Disallow: /wp-*
line?
I have just received an email from Google advising that it can't accessing certain javascript and css content from my site.
I've looked at the robots.txt file which contains:
User-agent: * Crawl-delay: 5
Disallow: /feed/
Disallow: /trackback/
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /xmlrpc.php
Disallow: /wp-*
It looks like it is the Disallow: /wp-*
that is doing the damage.
I am just going through the process of disabling each plugin in turn to see which one (if any) is causing this line to appear in the robots.txt file, but could there be another reason for it (e.g., core WordPress feature/setting)?
And is it fine and safe for me to just remove this Disallow: /wp-*
line?
3 Answers
Reset to default 1It seems to be a WP default setting, as many Webmasters have gotten this warning and never edited the robots.txt. Removing all the disallows is the easiest solution, but I assume you want some or all of those directories blocked.
Google is only concerned about the .js and .css files, so you could in theory edit the robots.txt to include:
User-Agent: Googlebot Allow: /.js Allow: /.css
However, being that specific could require future changes to the user agent, in case more search crawlers follow Google's example.
You want to make sure you know how robots.txt work so you don't accidentally block your entire site or important sections. Here is a good reference for more details about robots.txt:
http://www.robotstxt.org/robotstxt.html
I have sorted this now. I'm not sure where the original robots.txt content could have come from(??), but I have now changed it on the origin server to:
User-agent: * Crawl-delay: 5
Disallow: /feed/
Disallow: /trackback/
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /xmlrpc.php
Disallow: /wp-content/
Disallow: /wp-*
Also, the site uses a CDN, so I specified a seperate set of rules for the CDN's robots.txt file:
User-agent: *
Allow: /wp-content/
Disallow: /
I would recommend the following:
User-agent: *
Disallow: */trackback/
Disallow: */xmlrpc.php
Disallow: /wp-*.php
Disallow: /cgi-bin/
Disallow: /wp-admin/
Allow: */wp-content/uploads/
本文标签: pluginsDisallow wp* in robotstxt
版权声明:本文标题:plugins - Disallow: wp-* in robots.txt? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736302048a1931394.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论