The Official Google Webmaster Central Blog recently announced that they now support the ability for you to specify the preferred version of a URL. This means that following these guidelines will help you eradicate your site’s duplicate contents that Googlebot sees.
Why would you do such a thing? Simply because many black-hat SEO folks abuse duplicate content to gain search ranking and Google tries really hard to detect and penalize them. The last thing you want to do is present yourself as an SEO spammer to Google.
In the post, Google is saying that you can easily tell the Googlebot the preferred version of a page by specifying the following tag within your <head></head> tag:
<link rel="canonical" src="http://example.com/your/preferred/version/of/this/page"/>
SEO No Duplicate WordPress Plugin
I have made a plugin that does this for you. Visit the plugin page!
No Plugin? No Problem
If you don’t want to download another plugin, you can just place the following code into your functions.php file within your theme folder.
function set_canonical() { if ( is_single() or is_page() ) { global $wp_query; echo '<link rel="canonical" href="'.get_permalink($wp_query->post->ID).'"/>'; } } add_action('wp_head', 'set_canonical');
It turns out that the code above does not handle all types of WordPress pages. I highly recommend downloading the SEO No Duplicate WordPress plugin to do this for you instead!
That’s it! Now if you go to any version of your post page, you will see the little link on the top of the page publicly telling bots that the preferred version of the page is the permalink version. Take that duplicate contents!
This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.