Post Pic

How to: Avoid duplicate content in paged comments

Introduced in WordPress 2.7, paged comments are great, especially when you have lots of comments. Thought, if your <title> tag isn’t optimized, your blog could produce some duplicate content, which is bad for SEO. Here’s how to avoid it.

Open your header.php file. Find the </title> tag and paste the following just above:

<?php if ( $cpage < 2 ) {}
else { echo (' - comment page '); echo ($cpage);}
?>

Allright, after you saved the file you can say goodbye to duplicate content!

Credits goes to Malcolm Coles for this awesome recipe!

17 Responses

Mar 06 2009 11:54

Thanks for your thanks (got the pingback). But the link doesn’t work as it says herf not href in your code! Cheers – malcolm.

Mar 06 2009 14:14

Google just released a canonical tag. We can make sure of that tag to resolve duplicated content issue in paged comment. You can check out one of my post.

Mar 06 2009 14:52

Using canonical link tag is more “official” approach. I agree. But it also includes problems that I want to see resolved. For instance, if a popular blog with 2 paragraphs in a post gets hundreds of comments, why should page 2, 3, and on duplicate content?

I doubt it is how canonical link tag is intended to be. Well, this is not a place for my rant about it but…

Adding a short string to the title doesn’t make content unique. I don’t know for sure, but Google looks beyond just title.

Mar 06 2009 16:43

That is a nice quick useful recipe. Thanks

Mar 06 2009 20:43

Wouldn’t disabling the paged comments take care of this easily?

Mar 07 2009 00:54

Kevin – yes, turning it off altogether solves this problem. But you may prefer it on if you have lots of comments.

Chung Bay Luen – rel=canonical isn’t really an option for paginated comments, as a post with 200 comments over 4 pages doesn’t really fit into the rel=canonical usage …

Hendry – no, it doesn’t make it unique on its own. But for humans, adding ‘page X’ helps them differentiate it in the results. For search engines it helps a bit – also try using the excerpt on pages >1 of comments. And doing something similar to this title usage on your meta description.

Everyone – rememver this is a problem even if you have few comments. The new version of WP seems poorly coded from an SE point of view, as /comments-page-1/ exists with the same content if pagination is turned on, even if you have no comments.

Mar 07 2009 09:23

@Malcom: Corrected, sorry for this!

Mar 07 2009 17:10

Man, so many things to worry about. Thank God for this site pointing them out, lol.

Mar 07 2009 18:26

Nice. Definitely useful hack.

Mar 07 2009 19:50

Nice, that’s very useful :)

Mar 10 2009 00:50

Very useful tip indeed. Duplicate content hurts website rankings, and it is very important to make on site optimization perfect.

Mar 13 2009 18:00

Very useful and helpful tip !! Thanks a ton !!

Apr 13 2009 02:48

how can the page comment give a duplicate content? I mean, people leave comment with different words and sentences. I don’t get what it means, can anyone tell me? thanks

May 23 2009 23:17

You will remove title, but post content will still be shown on all comment pages.
If you REALLY want to avoid duplicate content, use this plugin from wordpress repositary.

Jun 19 2009 06:53

Duplicate contents really hurts. Thanks for the nice and helpful tip.

Aug 31 2009 18:00

I think using rel=cannonical can avoid penalty that caused by duplicate content.

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required