viagra online without prescription vicodin online buy percocet buy adderall
New Webmasters > Search Engines > Why You Should Try To NOT Use The New Canonical Tag

Why You Should Try To NOT Use The New Canonical Tag

Google Logo

Google supports the new tag

Last week, Google, Yahoo and Live all announced their support for a new header tag called the “canonical” tag. This is designed to let you tell the search engines an alternative URL to index for a page.

It is designed to remove duplicate content issues from your web pages by letting you specify the correct version of the page. It is like a 301 redirect, but is a “strong hint” rather than an order.

A good example might be if you use information from the query string to sort data on a page. Your website might generate the following pages

  • http://example.com/cat1.php?sort=size&dir=desc
  • http://example.com/cat1.php?sort=price
  • http://example.com/cat1.php?sort=price&dir=asc
  • http://example.com/cat1.php?sort=avail&dir=desc

Search engines would regard each of these as individual pages, even though they are essentially the same page. The information is just in a different order.

Allowing URLs like this could be detrimental to your SEO efforts as your PageRank would be split between the pages, and people could be linking to the different versions of each page.

You could use the tag like this to remove this problem. There is a more technical explanation of how to use the tag over at the SEOmoz blog.

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

Lesson: DON’T Use This Tag

The examples given by Google underline something very important about this tag; you should be striving to never need to use it.

Here are some situations that you should never need to use the tag to resolve:

WWW vs Non-WWW URLs

In order to prevent duplicate content, a lot of websites redirect the non-www version of a URL to the www version. For example, accessing http://example.com will redirect you to http://www.example.com.

Lesson: use a 301 redirect

Fixing Sloppy Links Generated By Your CMS

The links generated by the CMS or online store in Google’s examples are the result of sloppy coding.

While accessing http://example.com/prod.php?p=fish and http://example.com/prod.php?p=fish&cat=animals will result in the same URL, these two links should NEVER be generated by a CMS. This is the result of sloppy coding. While using the canonical tag as a backup might be OK, you should never rely on it.

Lesson: Fix your coding errors first.

Remove Tracking And Affiliate Links From URLs

Search results are full of URLs with tracking IDs, such as those generated by Google Analytics URL Builder. Like this:

  • http://newwebmasters.net/?utm_source=email&utm_medium=gmail&utm_term=web&utm_campaign=test1

But these links should be logged, stripped from the URL and the user redirected, preferably via a 301 redirect.

Remove Session Identifiers

We are all familiar with sessions IDs in URLs. They look something like this:

  • http://www.example.com/index.php?PHPSESSID=a2sd433345gftr

These should never be used on publicly accessible URLs. If you use PHP, always choose the default cookie option for recording session identifiers. Using identifiers in the URL is less reliable and less secure.

Google also claims that they are able to detect session identifiers in URLs, so in theory this shouldn’t be a problem.

Lesson: Never use sessions identifiers in your publicly accessible URLs. Never.

As an exception, one thing this tag will be great for combatting is the number of printable versions of documents I come across via search engines. There is very rarely a link to access the full version of the page directly from the printable version. If all these versions of pages were eradicated from the search results, I would be very happy. People should really be tagging these as noindex, but if they are featuring in the search results, I guess this won’t happen.

In Summary

As usual, most of these ideas are just my personal thoughts. While the new tag shouldn’t be necessary on your site, it is another useful tool to have handy.

But before you use it, think about what is happening on your website in the first place to make you need to use it.

Be Sociable, Share!

Discussion

One comment for “Why You Should Try To NOT Use The New Canonical Tag”

  1. Try this plugin: Canonical URL WordPress Plugin.

    Posted by 5ubliminal | March 26, 2009, 12:57 pm

Post a comment

viagra online without prescription vicodin online buy percocet buy adderall