Tuesday, August 7, 2012

What is rel="canonical"?

If you have two or more pages with similar content, you can tell Google which is your preferred page to show in the search engine results. This is referred to as your “canonical” page. If Google agrees this designated page is the best version, it will show this preferred page in its index.

To tell Google which page you want listed as the canonical page, add the following bit of code into the head section of the similar (non-canonical) pages:

<link rel="canonical" href="http://www.example.com/filename.html"/>

Naturally, you should replace the example.com/filename.html with your actual domain name and file name.

For example…

Example.com/file1.html is your preferred canonical page, the one you want displayed in the search engine results. You don’t have to add any tags to this site.

Example.com/file2.html and Example.com/file3.html have similar content to example.com/file1.html. As such, you’d place the canonical code within the <head> tag of these two sites to tell Google that example.com/file1.html is the most important page.

The most common reason to do this is to tell Google that these pages are all the same –
  • Example.com
  • www.example.com
  • www.example.com/index.html
  • Example.com/index.html

Don’t go overboard with this and certainly don’t use it on stuff like paginated comment pages because they are “similar” but contain the same post. They contain enough unique content to be treated as unique and Google will start to ignore your legitimate canonicals if it finds too many instances of you misusing it.

Yes, Google thinks it’s smarter than you, deal with it and move on.

No comments:

Post a Comment