Dukeo » WordPress » Avoid Duplicate Content: Easy Steps with WordPress

Avoid Duplicate Content: Easy Steps with WordPress

Steven 18 responses WordPress

As a WordPress blog owner it’s extremely important to prevent duplicate content from being indexed by search engines because it could have dramatic consequences for your rankings in the search engine’s result pages and consequently, for your traffic and money.

To avoir duplicate content penalty within your WordPress blog, simply paste the following code between the <head> and </head> tags in the header.php file of your WordPress theme:

if ((is_home() && ($paged < 2 )) || is_single() || is_page() || is_category()) {
    echo '<meta name="robots" content="index,follow" />';
} else {
    echo '<meta name="robots" content="noindex,follow" />';

This codes allows the indexing of your Homepage, single posts, single pages and category archives. On the other hand, it prevents the indexing of all the other pages of your blog. From this point, you shouldn’t be running into duplicate content issues anymore!

If you enjoyed this article,
Get email updates

Join for Free »


  1. Affiliate Manager

    Very cool. I hope the SEO plugins I already have installed do this :)

    1. Some of them do, some of them don”t. You should definitely check if yours does :)

  2. Gorman

    Very nice! Smooth move, guy, this is awesome.

  3. Shad

    I didn’t even know that could affect your rankings. Super helpful, thanks a ton once again for saving my ass!

    1. Anon

      He’s kind of an expert at doing that. “Saving asses one post at a time!” Thanks for posting so many great tools for us to use!

    2. Shad

      Yeah… but I think it’s more like: “Saving Shad’s ass like every single day” LOL! This is one of my regular sites that I go to for info. Always super helpful. :)

  4. Samie

    So grateful for this, what a wonderfully useful addition!

  5. Dana

    Wow, I feel so out of the loop, I didn’t even know this could be a problem! I will definitely make good use out of this, many thanks!

    1. Chris

      Yeah if you do a little research, you’ll actually see that it’s been quite a problem for a lot of people. But this seems like a relatively simple fix! Some people had their sites “filtered out” so it’s probably a good idea to use this.

    2. Jony

      I was one of those people. This is definitely useful tool, I highly recommend it.

    3. A lot of these “little tricks” have influence on your rankings. Even though it won’t have HUGE consequences, it adds up, so it’s always better to be careful with what you do on your pages.

  6. Sarah

    Honestly, anything that will help my SEO is something I need. Definitely need to get my hands on that free eBook of yours too!!

    1. Liz

      I’m getting one too! It’s right, what he always says, that free stuff is the best way to get someone hooked! It’s already working on me hahaha can’t wait to use it for my readers!

  7. Dr.kavita

    Thanks for the valuable info. But does not the All in one seo plugin take care of this issue? Please find time to reply because I am relying on the settings in that plugin to save me grief caused by duplicate indexing by search engines.

    1. Actually, I am not using All-in-one SEO, but Platinum SEO. Indeed, this plugin allows you to noindex categories, date-based archives, tag archives, RSS feeds, sub pages, author archives… However, I use these snippets of code instead of relying on plugins for a simple reason: it happens more than once that when you update a plugin, some settings are reset and if you don’t pay very close attention, your SEO efforts could be nulled. By hard-coding these features in my themes, I am always 100% sure that the setting will never change :)

  8. Affmaster

    This is brilliant, thanks so much for sharing. It’s nice to not have to mess with plugins… :)

  9. Dara

    Hi, I’m sorry for asking you this but what does it mean by all the other pages except home page, single post, single page, single categories? which are the other pages except these pages?


    1. It means, sub-pages of your homepage as well as tag pages.