Eliminating duplicate WordPress content in Google
If you are at WordCamp 2007, one of the best sessions was Google’s own Matt Cutts discussion on optimizing your WordPress blog. You can see the whole presentation over on John Pozadzides site’s One Man’s Blog. Here is the link. You can see in Matt’s Whitehat SEO tips for bloggers slide show that one of the things that WordPress “suffers from” is that you can reach the same data from multiple sources.
You can get to the same article by browsing by category, by day, month, year etc. etc. etc. Each time Google sees the same data repeated on your site again, it hurts your site a little bit more.
This bit of code will help fix it. It goes into the header part of your blog and will tell Google that it should ignore all of the pages that are not the orginal source of the article.
Here you go:
















Brian - I don't understand how to use this. What an I missing?
Comment by Kevin — November 7, 2007 @ 10:27 pm
Great post Brian. I will definitely plug it into my blog.
@Kevin - basically what the code does is tell the visiting google bots to only consider and index the actual post. If the bot found this post via the categories link or any other way through your blog, then you are kindly asking the google bot to not index it and hence hurt your ranking.
Just plug it into your header.php
Comment by John Motson — November 21, 2007 @ 10:44 am
@John - thanks for the input. What I was missing was how to format the code and it looks like Brian updated the post with that since my comment. Now I should be able to get it to work.
Comment by Kevin — November 21, 2007 @ 12:18 pm
Ah cool, sorry about that
Comment by John Motson — November 21, 2007 @ 1:30 pm
John - I'm glad you said something - I hadn't noticed the update to the post until your comment. Thanks.
Comment by Kevin — November 21, 2007 @ 1:58 pm
Sorry Kevin, I'd typed up a comment just so that you would be notified. I even went out to visit your site after I typed it up. I must have gotten so caught up in one of your posts that I forgot to hit "post comment" back here... Anyway, glad it makes sense now...
Comment by Brian — November 21, 2007 @ 2:58 pm
No problem Brian - I thought it was a little strange you hadn't replied to my comment but forgot about it and didn't come back to the post.
I've tried it temporarily on one of my sites and I'm not seeing any of the page headers show "noindex" only "index". Shouldn't it be showing the "noindex" on the category, month and years pages, etc.? Or am I not understanding how it works?
Comment by Kevin — November 21, 2007 @ 3:10 pm
Yes it should, did you have any caching installed on those pages?
Comment by Brian — November 30, 2007 @ 4:03 pm
No Brian - no caching was being used.
Comment by Kevin — November 30, 2007 @ 4:15 pm
Hey Brian great tip.
Ok maybe I'm just a dummy ( actually thats a foregone conclusion) But when I put that in my header.php I keep getting a parse error. I dont expect support but Could you , when you have the time maybe clarify where in the header, ive looked at how some of the php code is formatted and tried to duplicate to no avail
Cheers and Beers
Shane
Comment by shane — December 30, 2007 @ 6:17 pm
I have been visiting this site a lot lately, so i thought it is a good idea to show my appreciation with a comment.
Thanks,
Jim Mirkalami
Comment by Jim Mirkalami — February 8, 2008 @ 6:33 am
I think I saw a plugin that will do this, am I right?
Comment by Writing Contests — May 24, 2008 @ 12:03 pm
Very nice theme congrats.
Comment by Oliver — June 6, 2008 @ 3:55 am
I keep getting an error when I insert it into the header file. The php is formatted correctly so I don't get it. Is there any specific place it needs to be inserted?
Comment by Jason — June 30, 2008 @ 2:30 pm
Very useful information. Thanks!!
Comment by Max — July 1, 2008 @ 7:16 am
There are two things that could cause problems.
First is that I said is_singlar instead of is_single()
The second is that the quotes used might are being changed to the fancy directional quotes in some browsers. So, copy what is listed above and paste into your code anywhere you have a meta line in header.php. Then change the quotes from the fancy directional double quotes to the normal double quotes. That should get you going!
Comment by Brian — July 1, 2008 @ 9:30 am
Thanks nice blog regards!
Comment by SEO Algarve — July 16, 2008 @ 5:20 pm
wow thats great.. i appreciate it
Thank You
Comment by Niyaz — July 22, 2008 @ 3:04 am
Very interesting that Matt cares about WP bloggers and wants to help them gain better rankings in SE.
Thanks
Comment by psp games — July 22, 2008 @ 4:41 pm
Well Yeah its nice to prevent from google penalty and rest of stuff.. because duplicate content is harmful... Well its good now... Thanks for the Information
Comment by GamingMonk — July 25, 2008 @ 2:38 am
Very useful information for me. Thank you.
Comment by Maria — August 5, 2008 @ 7:12 am