User-agent: * Disallow: /cgi-bin Disallow: /wp-admin Disallow: /wp-content/plugins Disallow: /wp-content/themes Disallow: /wp-includes Disallow: /comments/feed Disallow: /trackback/ Disallow: /page/ Disallow: /category/*/page/ Disallow: /tag/*/page/
robots.txt可以用来告诉搜索引擎的爬虫,什么样的页面不用抓取。一般来说,WP的程序文件之类的肯定是要禁止抓取的,还有就是page页面,因为博客的PAGE页面是不停变化的,抓取了也没有啥用处,还浪费爬虫的时间去抓取别的东西。
把上面的这段代码保存为robots.txt文档,然后上传的网站的根目录下就可以了。