如何在Wordpress中限制或限制Google Bot索引或抓取某些内容?

时间:2014-03-01 15:51:40

标签: wordpress .htaccess robots.txt

好吧,我对Google Bot有疑问。每天带宽700MB带宽。对于那些显然会问我为什么要这样做的人来说。

我知道robots.txt,我可以阻止机器人索引某些文件夹。 但是在WordPress中,我使用的是名称后永久链接,因此帖子和页面的永久链接只是/ page或/ post。

搜索了任何插件,限制机器人仅对少量标签和少数类别进行索引,但没有找到它。

想要允许粘贴帖子,少数类别,少量标签。 可以做到?怎么样?

我对这个问题有了更新。 我决定选择robots.txt rulles。

User-agent: *
Disallow: /

User-agent: AhrefsBot
Disallow: /

User-agent: AhrefsBot/3.1
Disallow: /

User-agent: Yahoo-slurp
Disallow: /

User-agent: Msnbot
Disallow: /

User-agent: Googlebot
Allow: /
Disallow: /category
Disallow: /video
Disallow: /author
Disallow: /?s=
Disallow: /feed/
Disallow: /xmlrpc.php
Disallow: /cgi-bin/
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /wp-content/plugins/
Disallow: /wp-content/cache/
Disallow: /wp-content/themes/
Disallow: /wp-login.php
Disallow: /wp-register.php
Disallow: /tag
Allow: /tag/marry
Allow: /tag/john

将最后两个标签编入索引吗? 在WordPress中还有更多要隐藏的内容吗?

1 个答案:

答案 0 :(得分:1)

如果您想允许特定帖子但不允许其他所有帖子,请使用Allow标记。例如:

User-agent: Googlebot
Allow: /post/foo
Allow: /page/bar
Disallow: *

因此机器人可以抓取您指定的页面,但不能抓取任何其他内容。