适合 WordPress 的理想 robots.txt 吗?

适合 WordPress 的理想 robots.txt 吗?

我浏览了网络,试图找到托管 WordPress 博客的理想 robots.txt 内容。我找到了几个选项,例如这里这里

我认为这对于 ServerFault 来说是一个好问题:对于 WordPress 上的“简单”博客,理想的 robots.txt 是什么?

目前我有在网络其他地方找到的以下 robots.txt:

User-agent: *
Disallow: /cgi-bin
Disallow: /wp-admin
Disallow: /wp-includes
Disallow: /wp-content/plugins
Disallow: /wp-content/cache
Disallow: /wp-content/themes
Disallow: /trackback
Disallow: /feed
Disallow: /comments
Disallow: /category/*/*
Disallow: */trackback
Disallow: */feed
Disallow: */comments
Disallow: /*?*
Disallow: /*?
Allow: /wp-content/uploads


# Google Image
User-agent: Googlebot-Image
Disallow:
Allow: /*


# Google AdSense
User-agent: Mediapartners-Google*
Disallow:
Allow: /*


# Internet Archiver Wayback Machine
User-agent: ia_archiver
Disallow: /


# digg mirror
User-agent: duggmirror
Disallow: /

谢谢

答案1

没有“理想”的 robots.txt,但会有一个最适合您的 robots.txt。只需确定您希望机器人查看的内容,然后创建一个禁止其他所有内容的 robots.txt。不需要“允许”行,因为机器人会解析这些文件以确定您不希望它们查看的内容,然后假设其他所有内容都是公平的游戏。例如,我自己的 robots.txt 中适用于 wordpress 的部分是:

Disallow: /blog/wp-*.php
Disallow: /blog/wp-admin/
Disallow: /blog/wp-includes/
Disallow: /blog/wp-content/

答案2

我以前从未考虑过robots.txt在 wordpress 中使用文件 - 我只是确保我不希望随机用户运行的文件(例如安装程序或升级程序)的权限是正确的。

相关内容