Skip to Content
 

What is rel=canonical?

Posted by: 
Jeff Jerome
Posted date: 
Fri, 2009-03-20

First, let's start with the rel attribute. According to the W3C, the rel attribute describes the relationship of the current document to the linked one. Most common use of the rel attribute is for css: <link rel="stylesheet" href="/css/styles.css" /> That's saying /css/styles.css is the stylesheet for this page. Easy, right? There are many other relationships, which can be found on the W3C site.

Ok, back to canonical. I didn't even know what canonical meant before this. You think I would have looked it up, as I'm writing this on Ubuntu right now. Although "Canonical" has many meanings, in regards to web pages and SEO it means preferred. So, the canonical url for Acme Widgets Inc. could be acmewidgets.com or www.acmewidgets.com or even youshouldbuy.acmewidgets.com. It's whatever the business wants the url to be.

How can this be used with regards to SEO? Earlier this year, Google, Microsoft, Yahoo! and Ask.com all agreed to support the canonical attribute with regards to duplicate content. Duplicate content can have a negative affect on your website's ranking because search engines like content, especially good, clean, unique content. To me, having a bunch of pages with a lot of the same content (upwards of 95% if you remember) is essentially stuffing your site with keywords. But there could be legitimate reasons you have duplicate content, like if you have multiple categories that could share the same items, or in the case of an indexable wiki, having multiple url aliases for a certain article.

So what the search engines agreed on was that sometimes duplicate content is ok, and if you tell them about it it's no big deal. Now you can put it in the <head> of your document:

<link rel="canonical" href="/path/to/preferred/page.html" />

and you should be good to go.

 

However, it'd be nice to avoid this altogether, if possible. A few tips:

  • Standardize your urls: don't have some links be relative and others absolute, and pick www or not from the beginning if possible
  • Use consistent linking: web servers can rewrite urls for default pages, for example, but you should link to them in the same way all the time.
    acmewidgets.com = acmewidgets.com/ = acmewidgets.com/index.html, but just pick one and stick to it.

There are more tips and several issues and reasons to use the canonical link. I'll let the gentleman from Google explain in detail.

A good resource is Google's Webmaster Help

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options