


通常,解决重复内容的方法有:使用noindex标签,利用excerpt实现内容摘要,以及配置robots.txt。今天就主要说说在WordPress下使用robots.txt文件。
robots.txt文件就像一个网站的大门,它会告诉搜索引擎的蜘蛛,可以抓取哪里的网页内容,哪里的不能抓取。因此,配置好robots.txt文件,完全可以理想的组织blog内容重复的问题。robots.txt的具体文法和使用方法,可以参考robotstxt.org。在国内,此类的WordPress robots.txt比较流行:
User-agent: *
Disallow: /wp-
Disallow: /feed/
Disallow: /comments/feed
Disallow: /trackback/
Disallow: /?s=
刚才看到 filination.com上面提到的一个robots文件,并且提供了简短的解释。刚刚接触robots.txt文件的朋友,可以参考一下:
User-agent: Googlebot
# Disallow all directories and files within
Disallow: /cgi-bin/
Disallow: /wp-admin/
Disallow: /wp-includes/
# Disallow all files ending with these extensions
Disallow: /*.php$
Disallow: /*.js$
Disallow: /*.inc$
Disallow: /*.css$
# Disallow parsing individual post feeds, categories and trackbacks..
Disallow: */trackback/
Disallow: */feed/
Disallow: /category/*
Robots.txt因人而异,不同的人对robots有不同的理解,在加上SEO一直是一个热门话题,所以WordPress的robots文件不会是唯一的,也不会有一个最好的。大家要是有觉得更好的,不妨分享一下。



亲爱的:若该文章解决了您的问题,可否收藏+评论+分享呢?
文章评论 本文章有个评论