WordPress 2.7 分页评论导致的SEO问题

作者:feir 发表于:2008-12-18,#5条评论。

WordPress 2.7的评论分页功能对于评论比较多的博客而言是个很好的功能,可以有效的减少页面体积,但是同时分页评论功能也会造成一个与SEO相关的问题——复制内容。wp-hackers邮件组里就有人指出这个问题了。

Isn’t this bad for SEO? We now have a post with multiple pages, but
the post content is repeated over multiple URLs. This will screw up
search engines, as well as site stats (popular posts will end up
“splitting the vote” between comment-page-1, comment-page-2, comment-page-3, etc…)

对于开启了分页评论的文章页面,wordpress是使用以下URL格式来对各个分页进行标记的:
http://example.com/my-post-permalink/ (文章页面主页)
http://example.com/my-post-permalink/comment-page-1/ (评论分页第一页)

http://example.com/my-post-permalink/comment-page-2/(评论分页第二页)

这几个页面的主体内容其实是一样的,页面文字除了具体评论有变化外其余的都一样,title是一样的,meta内容也是一样的。所以就有人质疑,分页评论是否会为Wordpress2.7博客增加复制内容这一SEO问题。

现在提供一个解决办法,通过在Wordpress主题的fuctions.php里添加一段PHP代码就可以。这个代码解决复制内容的思路是让各评论分页与文章主页的post内容显示不一样,评论分页上只显示文章摘要。

[php]function seo_paged_comments_content_filter($t = ”) {
$cpage = intval(get_query_var(‘cpage’));
if ( ! empty( $cpage ) ) {
remove_filter(‘the_content’, ‘seo_paged_comments_content_filter’);
$t = get_the_excerpt();
$t .= sprintf(‘

%2$s

‘, get_permalink(), get_the_title());
}
return $t;
}
add_filter(‘the_content’, ‘seo_paged_comments_content_filter’);[/php]

{ 5 comments }

1 百家乐 12-30 at 10:46 am

又学到了东西

2 雪深 01-12 at 2:17 pm

我曾经遇见过 最好放弃分页了

3 天真 01-13 at 10:36 am

确实一般的博客不需要评论分页,分页评论对于用户来说不一定是体验好的。

4 seo 01-14 at 8:08 pm

wordpress的功能不错,2.7版更是强大了。

5 97gan 03-23 at 3:52 pm

2.7版更是强大了。

Comments on this entry are closed.

Previous post:

Next post: