Subscribe via RSS


WordPress Tips: Remove Duplicate Content


WordPress is a great blog tool, and it is very versatile, but one thing it does is create many pages of duplicate content. Duplicate content can be seen by search engines like Google as a bad thing, and they will basically "subtract points" from your site, and position your content lower in the search engine results.

You can fix this problem in WordPress though using one or both simple methods listed below. I currently prefer the second method which does not rely on a plug-in or on search engines actually following NOINDEX rules.

WordPress Plug-in

Over on WPSEO.com there is a plug-in for WordPress that unlike my example below, doesn't change the display of your blog content at all, but instead informs search engines on where to find your content, blocking them from all other places it might be repeated.

"DupPrevent Plugin controls NOINDEX meta tags to prevent duplicate content penalty. Additionally the plugin includes robots.txt file to disallow search engines to spider feeds, trackbacks and the wp- directories."

Installation

1. Download DupPrevent.zip.
2. Extract dup-prevent.php and robots.txt from the DupPrevent.zip.
3. Upload dup-prevent.php to your wp-content/plugins directory and activate it.
4. Upload robots.txt to your site’s root directory. You should be able to see the file by going to http://yoursite.com/robots.txt

The plugin is for WordPress 2.0 and higher. No word yet on if it also works with the upcoming WordPress 2.1.

Template Code Changes

One of the best tips I ever got from Jaimie Sirovich of SEO Egghead was to make sure that the full text of my posts only appeared on the index page and when looking at the single post, and making sure everything else was no more than an excerpt. Excerpts are short summaries of posts and are much less likely to cause any negative search engine effects, thus allowing your single posts to rank higher on search engines like Yahoo and Google.

Here is how I did it:
Take the below code and put it in your theme's index.php file replacing something that will probably look like:

PHP:
  1. <div class="postentry">
  2.    <?php the_content(__('Read the rest of this entry &raquo;')); ?>
  3. </div>

With this:

PHP:
  1. <div class="postentry">
  2. <? if (is_home() && (!$paged || $paged == 1) || is_search() || is_single() || is_page()): ?>
  3.    <?php the_content(__('Read the rest of this entry &raquo;')); ?>
  4. <? else: ?>
  5.    <?php the_excerpt() ?>
  6. <? endif; ?>
  7. </div>

This basically says, if we are on the home page, single post, single page, or search, show the full content, otherwise only show an excerpt. Some people like Jaimie Sirovich came up with their own PHP code to control how long the excerpts are, but I used the built-in WordPress function, and I recommend you do as well.