Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何允许或限制谷歌机器人在Wordpress中索引或爬网某些东西?_Wordpress_.htaccess_Robots.txt - Fatal编程技术网

如何允许或限制谷歌机器人在Wordpress中索引或爬网某些东西?

如何允许或限制谷歌机器人在Wordpress中索引或爬网某些东西?,wordpress,.htaccess,robots.txt,Wordpress,.htaccess,Robots.txt,嗯,我对谷歌机器人有问题。每天占用700MB的带宽。这是为那些显然会问我为什么要这样做的人准备的 我知道robots.txt,我可以阻止机器人为一些文件夹编制索引。 但在WordPress中,我使用的是post名称permalinks,所以post和pages的permalinks只是/page或/post 搜索任何插件来限制机器人只索引少数标签和少数类别,没有找到它 希望允许粘贴帖子、少数类别、少数标签。 可以吗?怎么做 我有这个问题的最新情况。 我决定用robots.txt rules Us

嗯,我对谷歌机器人有问题。每天占用700MB的带宽。这是为那些显然会问我为什么要这样做的人准备的

我知道robots.txt,我可以阻止机器人为一些文件夹编制索引。 但在WordPress中,我使用的是post名称permalinks,所以post和pages的permalinks只是/page或/post

搜索任何插件来限制机器人只索引少数标签和少数类别,没有找到它

希望允许粘贴帖子、少数类别、少数标签。 可以吗?怎么做

我有这个问题的最新情况。 我决定用robots.txt rules

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中还有什么隐藏的吗?

如果您想允许某些帖子,但不允许其他任何内容,那么请使用
allow
标记。例如:

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

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

您可以使用
%{HTTP\u USER\u AGENT}