rel=canonical – Canonical URL links

Matt Cutts has just announced a new tag at SMX West Google, Yahoo and Microsoft have just announced a new link element, henceforth to be known as rel=canonical, which we can use to tell the search engines which URL it should have for the current page. This is probably best explained with an example, so here goes.

Suppose you have read my Twitter Analytics post, and you’ve started tagging all the URL’s you spread on Twitter with Google Analytics campaign variables. So at some point, Google enters your site through this URL:

If it did, in “old times”, this would mean you’d have a duplicate content issue: the same content indexed under two different URL’s. An issue SEO’s have been trying to solve on web pages for ages, which sometimes created huge limitations. This is where the new tag comes in. You add this rel=canonical link to the <head> section of your page:

<link rel="canonical" href=""/>

And now, Google will suddenly count the links it has seen to that campaign tagged URL, towards the canonical URL, and not index the campaign tagged URL anymore. Simple, yet effective. Cool huh?

Disclaimer: this rel=canonical tag is only a “hint” to the search engine. While they’ll probably use it 99% of the time, they reserve the right to handle things any way they want, in case of errors etc.

Of course this isn’t just useful for campaign tagging. Many a webshop needs the URL to store sort variables, for instance. But a page that’s sorted by price ascending, is often almost the same as a page sorted by price descending.

wordpressNow I have to admit I had a bit (like a couple of days) of a headstart on this one, so I can now make it easy for you if you’re running WordPress, as I’ve got a Canonical URL plugin ready for you!

magento-logo.pngAlso, if you’re using Magento E-Commerce, I’ve collaborated with Joachim Houtman to make this Magento canonical URL’s extension for you, that does this for you in Magento!

drupal_logo.gifWorking with Marek Sotak, we’ve also developed a module for Drupal that does this, by modifying the global redirect module. Grab it here. Note: this is not an official release of this module, we’ll do that soon.

If you’ve written a plugin or extension for another open source system that does this, or would like to work with me on doing so, let me know in the comments!

228 Responses

  1. Allan Collins
    By Allan Collins on 12 February, 2009

    Very nice.

    Thank you for this.

  2. Coen Jacobs
    By Coen Jacobs on 12 February, 2009

    This is what I have to call: innovation! Really great stuff, thanks for the plugin Joost!

  3. todd g @
    By todd g @ on 12 February, 2009

    wow, installing now, brilliant that you have the plugin ready to release with the new news… thanks for the plugin!

  4. Chris Clarkson
    By Chris Clarkson on 12 February, 2009

    The first thing I thought of is how this is going to encourage sites to run their affiliate programmes in-house. The major issue before was the chance one of your affiliate URLs gets indexed rather than your own.

    This seems to solve that, allowing for merchants to take any PR gain while losing the risk?

  5. Richard
    By Richard on 12 February, 2009

    super cool! love it.

  6. Rasmus
    By Rasmus on 12 February, 2009

    That is some fast developing :) Great work.

    Does the wp plugin handle if several pages uses the same canonical url?

  7. gerben
    By gerben on 12 February, 2009


    Well, one other issues Affiliate programs sometimes have, is that they redirect (and not always nicely) so their OWN url gets indexed, you can’t prevent that.

    But aff programs using a substitute on your own url, yup, it’s for 99% resolved now :-)

  8. Olivia Bell
    By Olivia Bell on 12 February, 2009

    Brilliant! Thank you.

  9. Donace | The Nexus
    By Donace | The Nexus on 12 February, 2009

    That WAS QUICK!

    So in theory now we should ad rel=can… to all links that are so it will supercede in ranking?

  10. JG
    By JG on 12 February, 2009

    This will help clear up link spillage into non-canonical versions of dup content, but will this indicate to the SE’s to not count all non – canonical versions of the page in the index?

  11. michelle
    By michelle on 12 February, 2009

    What if anything might this do to help with sploggers and the dupe content issue?

  12. Danelle Ice (Homemaker Barbi)
    By Danelle Ice (Homemaker Barbi) on 12 February, 2009

    Thanks for all the great plugins you write! I have read so many helpful posts on your site and wanted to comment on them, but noticed the comments were closed on many. Could I ask why they are closed?

    Danelle Ice / Homemaker Barbi

  13. technabob
    By technabob on 13 February, 2009

    I jsut tested out this plugin on my site and was finding that paginated URLs such as “” get assigned the canonical of “”, even though the content on page 8 is completely different than the content on page 1. Is this right, or is this a bug?

    • technabob
      By technabob on 13 February, 2009

      I guess I should have mentioned that I’m running the WordPress version.

      • Joost de Valk
        By Joost de Valk on 9 March, 2009

        It’s fixed in the version now available on, an automatic update should appear shortly.

  14. Jesse Heap
    By Jesse Heap on 13 February, 2009

    Way to go getting this out so fast.

    Any try testing this on a tag page? I’m not getting the canonical link on tag pages. Also I noticed if you have paged content the url defaults to the main page i.e.

    This page:

    Has the following link:


    • Joost de Valk
      By Joost de Valk on 9 March, 2009

      You’re right. I’ve just committed the whole thing to and fixed this bug in it, so an automatic update should appear soon :)

  15. ElbertF
    By ElbertF on 13 February, 2009

    Nice article, interesting news. :) I modified my CMS to include the meta tag.

  16. Justin Davey
    By Justin Davey on 13 February, 2009

    Hey Joost! Awesome work on the plugin! I also use the duplicate content cure plugin by Badi Jones–can I deactivate it, or should I let it be?



  17. Tyo
    By Tyo on 13 February, 2009

    hmmm… nice tips. Great plugin.

  18. Tom@S
    By Tom@S on 13 February, 2009

    i install this plugin, but i am not sure what it does. I have this rel=cano… on every sub page. For what is this good, if is not duplicate content? On webmaster blog was article about duplcitace and canonical problem and this tag help google to find primary page, what is main pros, if i have this tag on every page if is not duplicate to any other?

  19. tfirdaus
    By tfirdaus on 13 February, 2009

    I’ve just installed this plugin into my WordPress and the result look like this

    (with slashtrailing)

    how to change this into (without slash trailing)?
    since my website isn’t

  20. Martijn
    By Martijn on 13 February, 2009

    I hadn’t noticed the Yoast campaign tagging until I replied to this post. From that I see I came here from my RSS reader.

    Expect a lot of clutter to be added to website URL’s as everyone is now more or less free to do as they please.

  21. Jeff
    By Jeff on 13 February, 2009

    Great plugin. Thanks for writing it.

    It appears to also add to the a blank line, and several spaces before the tag.

    Is that a problem?

  22. Sushubh
    By Sushubh on 13 February, 2009

    i assume you have added this to wordpress’ official plugin directory for auto updates in the future?

  23. Sushubh
    By Sushubh on 13 February, 2009

    Ok, One major issue…

    A lot of people are going to try installing it using the WordPress’ new install plugin from backend feature.

    Your zip file contains the macosx folder that is also extracted on the server… that breaks the blog for me just as i install it.

    I suggest that the zip file contains the php file in a folder and the macosx folder be removed from it.

    and of course, make it available on the list.

    • Joost de Valk
      By Joost de Valk on 9 March, 2009

      It’s now on

  24. Inge Janse
    By Inge Janse on 13 February, 2009

    This is outstanding news from all search engines, and an outstanding plugin! I just gave up working with the RSS Link Tagger (, because it messed up my google results (indexing both the normal url and the url with rss tags included). Now I can continue using url tags without having to fear duplicate content. Hip hip hooray!

  25. Michel
    By Michel on 13 February, 2009

    Nice plugin! Thnx.

  26. cubus
    By cubus on 13 February, 2009

    Thanks for the update and the plugin, will sure come in handy on future wordpress projects.

    I think this Canonical ULR would also be very useful in Social Bookmarking too.

  27. newtowordpress
    By newtowordpress on 13 February, 2009

    Great. Just installed and now my blog is broken. No clue how to fix. Got fatal error. Any help would be appreciated!!!

    I can only assume its got someting to do with the macos folder. Still doesnt help me fix.

    • sushubh
      By sushubh on 13 February, 2009

      go to plugin folder through ftp and delete the macosx folder. i think you installed the plugin using the wordpress backend :)

  28. Wendy Merritt
    By Wendy Merritt on 13 February, 2009

    I have read three different articles on this new revelation from Google/Yahoo/Microsoft. I have no idea. Due to the recommendation of several SEO mentors I am installing your plugin even though I have no idea why…LOL

    Twitter: WendyMerritt

    • sushubh
      By sushubh on 13 February, 2009

      one thing is for sure, it wont cause any harm,,, it just gives a bit more info about a webpage to the search engines… that is never a bad thing!

  29. Stefanos
    By Stefanos on 13 February, 2009

    Drupal’s module here it gives an emty zip file!
    any help pls???
    Thank you

    • Joost de Valk
      By Joost de Valk on 13 February, 2009

      Fixed that, thx for mentioning it!

  30. Tilak
    By Tilak on 13 February, 2009

    Nice job!!!
    I have installed now.
    Thank You

  31. Agent SEO
    By Agent SEO on 13 February, 2009

    Hey Joost…nice work on the plugin.

    Quick question. Is there any sort of limit to how many canonical URL’s you can place in your column? After a while wouldn’t your page size get too big & cumbersome?


  32. Drew Stauffer
    By Drew Stauffer on 13 February, 2009

    This sounds like a great plugin.

    I wonder…could you use this method when your adding your posts to multiple categories?

    That way you could have your posts show up in multiple categories, but have one dominant category that gets all the PR.

  33. Jordan McCollum
    By Jordan McCollum on 13 February, 2009

    Second on Drew’s question and another (which may of course be resolved once I dl and install): does this fix the issue with paged comments in 2.7?

  34. Thomas
    By Thomas on 13 February, 2009

    Nice work; it tested out well. One nit to pick on line 192 (globalredirect_goto): Instead of manually building the tag, you really should use drupal_add_link().

    ‘rel’ => ‘canonical’,
    ‘href’ => url($request, array(
    ‘query’ => $query_string,
    ‘fragment’ => $fragment,
    ‘absolute’ => true,
    ‘alias’ => true

    I tested it and it worked fine.

  35. d-vey
    By d-vey on 13 February, 2009

    Nice post! ^^

    I’m using Joomla (1.0), is there a possibility that you are going to make a plugin for that as well?

  36. KingofSwing
    By KingofSwing on 14 February, 2009

    Thanx a lot for your very quick releae.

  37. John
    By John on 14 February, 2009

    How do we install this plugin?

    I uploaded to my server, but it does not appear under plugins in wordpress.

    When i view the file in windows, it just appears as a file, like it doesn’t have a file extension.

  38. Glenn
    By Glenn on 14 February, 2009

    Didn’t catch the answer to Tom’s question above: If this is on every header, how is that fixing the duplicate problem? What a wonderful thing if this all works.

  39. Max
    By Max on 14 February, 2009

    You’re a superstar, Joost. Plugin works like a charm!

  40. Sushubh
    By Sushubh on 14 February, 2009

    a question related to wordpress…

    comments pages. they are in wordpress 2.7…

    the plugin points to the primary post page even on comment pages… for example:

    has a canonical link pointing to

    i am not sure this is the correct thing to do because comment pages have comments different from the primary post page.

    just a thought :)

    • Joost de Valk
      By Joost de Valk on 9 March, 2009

      That’s actually not a bug but a feature. You want to be indexed for your main content, not have your main content appear twenty times. If a comment is so good that it adds to the post, it should be just that: added to the post, so everyone coming to that post can see it.

      • Sushubh
        By Sushubh on 9 March, 2009

        well yeah. that makes sense.

  41. Matt
    By Matt on 14 February, 2009

    Amazing stuff, thanks Joost!

  42. Jos
    By Jos on 14 February, 2009

    Thanks Joost. That’s very simple, yet effective. Great post. Cheers

  43. Joris Toonders
    By Joris Toonders on 15 February, 2009

    Great work Joost, thanks!

  44. orator
    By orator on 15 February, 2009

    nice wordpress plugin

    Thank you for this.

  45. Jeremy Luebke
    By Jeremy Luebke on 15 February, 2009

    I would love to see a separate module created for Drupal. GlobalRedirect is unusable at this time for some users, especially those on windows machines.

  46. Rick Imby
    By Rick Imby on 16 February, 2009

    This is pretty cool. All the biggies actually agreeing on something for a change. This will make things better.

  47. justin
    By justin on 16 February, 2009

    Great work :)

    I only have one concern: As much as SEO matters, human optimization matters too. To that end, I’d love to see the Drupal module have an option to do both: All of the /node/x and ‘dirty’ urls redirect using a 301, (which makes things more human friendly and linkable) and any url with excess query string hanging off of it has a canonical link in the head. This solves pages with analytics tags, pagers, etc.

    Also, please take Thomas’s suggestion above into consideration (for the Drupal module).

  48. Al-Kanz
    By Al-Kanz on 16 February, 2009

    Thanks for sharing

  49. Jeremy Wilken
    By Jeremy Wilken on 16 February, 2009

    I’ve created a plugin for Joomla 1.5 that works in conjunction with sh404SEF to add the canonical tag. I will keep working to get one that works without the extension, and one that will be 1.0 as well. Of course, its new so please let me know of bugs or difficulties.

    Check it out here

  50. BrandMover
    By BrandMover on 16 February, 2009

    A master dupe cleanse with the WP plugin works great.
    Thanks Yoast!

  51. Matt
    By Matt on 17 February, 2009

    Really appreciate the plugin. Thanks for distributing this.

  52. Winwab
    By Winwab on 17 February, 2009

    Thanks for this great plugin. I really appreciate the plugin.

  53. Sarsura
    By Sarsura on 17 February, 2009

    Thank you very much for this plugin (WordPress).

  54. Pawe? Zinkiewicz
    By Pawe? Zinkiewicz on 17 February, 2009

    Thanks for this one Joost.

  55. Jim Westergren
    By Jim Westergren on 17 February, 2009

    What exactly does the wordpress plugin do? I have read thru the code but don’t really get it. I would be thankful for this information for my article about it.

  56. twokad
    By twokad on 17 February, 2009

    Thank you for the WP plugin! :-)

  57. Nikki Backshall
    By Nikki Backshall on 18 February, 2009

    Thanks for such great plugins. We’ll be making use of both the WordPress and Magento plugins, you make our lives a whole load easier!

  58. Rudi
    By Rudi on 18 February, 2009

    I’m using SEO No Duplicate plugin ( for canonical issue. Which one is better? SEO No Duplicate plugin or Canonical URL plugin? Thanks

    • Thaya Kareeson
      By Thaya Kareeson on 19 February, 2009

      They’re both pretty much the same thing. :)

  59. Raj
    By Raj on 18 February, 2009

    It displays the message “Cannot open file: It does not appear to be a valid archive” when downloaded the plugin and tried to open it (multiple times) !

  60. GrefTek
    By GrefTek on 18 February, 2009

    Sweet WP plug. Saves me the trouble. ;)

  61. Diamara
    By Diamara on 20 February, 2009

    We’ve written a very simple Firefox plugin that lets you see the canonical URI for a page without having to view source. This site was very useful during testing as very few other sites have implemented the tag yet!

    You can get the Wahanda canonical tag extension here

  62. Kieran
    By Kieran on 20 February, 2009

    This is a pretty cool plugin but doesn’t seem to do anything on my blog. Has anyone got an example of it work. Does it only work with a particular version of WordPress ?

  63. Effective Web Design
    By Effective Web Design on 22 February, 2009

    Thanks for the plugin, but i think it’s easier just to edit the theme and paste meta tag, than using plugin, on my web Effective Web Design site i just included the meta tag and it works perfect. I hope other search engines to implement this tag too.

    The idea of the canonical url is great and will solve a lot of problems.

    • Justin Hileman
      By Justin Hileman on 22 February, 2009

      I don’t think you quite understand what this plugin does. It isn’t for canonical domains, it is for canonical pages… For example, if a blog post has multiple pages of comments, but duplicates the post at the top of both pages, the paginatio will create “duplicate content”. So would include a canonical link to It isn’t a single canonical link for the whole domain… It’s a canonical link anywhere duplicate content appears within the domain.

  64. Rudi
    By Rudi on 28 February, 2009

    I have installed Canonical URL links plugin, but it changed nothing, I still have 124 duplicate meta description, 48 duplicate tag title. I also have installed robot meta plugin and the plugin prevents google boot to index my latest posts. Now I’m stuck…..

  65. Ophir
    By Ophir on 1 March, 2009

    Fantastic! Keep it going.

  66. DN Technologies
    By DN Technologies on 1 March, 2009

    Very nice post. My wife is very much into WordPress lately so I’ve bookmarked and will show her this post. Thanks for the great info!

  67. neville
    By neville on 13 March, 2009

    Interesting stuff. I’ll go end try it out. Thanks for posting ;-)

  68. Muri(perfect money)
    By Muri(perfect money) on 16 March, 2009

    So far I always looking for the best way to make my WordPress URL more Google friendly ,and thanks for this post now I could get the mission done and since I need to try this first ,whether this is a good plug in or not ,I will tell here later after trial,but in advance my appreciations for this plugin

  69. John Currie
    By John Currie on 19 March, 2009

    For anyone running a WordPress ecommerce site, this is going to be of great value. I believe this plugin is going to help me a lot, Thanks!

  70. AhmadDani
    By AhmadDani on 26 March, 2009

    Thanks for your drupal module. But that module for Drupal 6.x. What about module for Drupal 5.x? Do you provide it?

    Thank you

  71. Albert
    By Albert on 27 March, 2009

    thank you for the information. I may apply it in my next seo project.

  72. Nixan
    By Nixan on 2 April, 2009 and – both these urls rank for canonical url links (this might be very obscure term) but canonical kind of works like 301 redirect. Why these two duplicate urls should rank for one keyword on the same page?

  73. Techcrawler
    By Techcrawler on 15 April, 2009

    Nice wordpress plugin for canonical tag :)

  74. Baseball Handicapping
    By Baseball Handicapping on 18 April, 2009

    I have used these tags a few times and it doesn’t seem to make much of a difference.

  75. Support Your Sound
    By Support Your Sound on 11 May, 2009

    Fantastic, thank you, i’ve just got onto Magento and your posts are very useful

  76. Ismail Popov
    By Ismail Popov on 14 May, 2009

    I’m just about to start a WP blog and was looking for good plugins for SEO, so really nice hit here. Thanks :)

  77. brent
    By brent on 15 May, 2009

    I might be missing something here, don’t you just have to add this to your header file:

    <link rel="canonical" href="" />

    your plugin is obviously doing a lot of stuff manually, is the above code better or worse or equal in it’s SEO benefit to your plugin?


    • Joost de Valk
      By Joost de Valk on 15 May, 2009

      the above code is a bit of a disaster SEO wise :) Read up on what canonical is, it’s not too hard, but it’s a tad bit harder than this.

      • brent
        By brent on 15 May, 2009

        I figured it wasn’t that easy, I just saw this code on a few sites stating that it was the way to go, obviously I was skeptical :D thanks for writing this, it’s a really great plugin


  78. venkat
    By venkat on 16 May, 2009

    there will be alwyas problems with canonical urls

  79. Deven
    By Deven on 30 May, 2009

    Exccelent plugin, You’re as always innovative!! Great Job Joost.

  80. Sajid
    By Sajid on 5 June, 2009

    Excellent plug-in, You’re as always innovative!!

  81. Tricks and tips on canonical url
    By Tricks and tips on canonical url on 8 June, 2009

    good wordpress plugin :) thank you

  82. helse
    By helse on 14 June, 2009

    Thanks for the explanation Yoast. Althought the Canonical tag still is a bit confusing – It helped.

  83. Blog On, Geek!
    By Blog On, Geek! on 16 June, 2009

    How does this module works?
    I tried patched version of global redirect from, but it just adds url specified as path alias to meta canonical tag. Is this module different?
    I also tried nodewords 6.x-1.x-dev, but it by default puts meta tag canonical to all every page so if it’s not specified it defaults to homepage, so it is useless.
    Does this module:
    – give separate field for meta canonical (separate field – other than path alias field)
    – if for any page canonical url is not specified, is header for that page free of canonical tag?

  84. Reviews
    By Reviews on 27 June, 2009

    very good job. it is very nice.thank you.

  85. david
    By david on 12 July, 2009

    after reviewing this post and the relevant google material i’m still somewhat confused on the correct application of the canonical tag.

    let’s say i have these urls:

    where productX is 99% identical across categories and the pages in category Y and Z are generated from (which is the url i want indexed)

    so i would want this tag:

    in the category Y and Z pages

    the only way for me to do this is to place this tag in the original page to which the canonical tag points. and as a consequence the tag will be placed in all pages generated from the original page and in the original page itself.

    is this a correct way to proceed? in other words, is there a downside to the canonical tag pointing to itself?

  86. ArtJ
    By ArtJ on 11 September, 2009

    Ok, one major issue not fixed in the Magento extension:

    Canonical link element is not showing full path in the URL, so for example: for the URL, the canonical link displays this skipping the category/subcategory part.

    I suppose it all depends on what is more important for your SEO – eliminating duplicate content issues or having your search terms in the URLs. Unfortunately with this extension you can’t have both.

    • Joachim Houtman
      By Joachim Houtman on 11 September, 2009

      You´re right. The idea is that the canonical URL should be the same as the sitemap URL, what is a good idea.. but Magento doesn´t add the category to the sitemap product URL. I have been working at a workaround, I will keep up-to-date.

  87. Suzanne of New Affiliate Discoveries
    By Suzanne of New Affiliate Discoveries on 17 September, 2009

    Wow, I think this address an issue I just discvoered with a new site I am working on. I use passed variables to keep track of my signups from various sources (blogger, squidoo, twitter, facebook,etc), but have found that google is indexing my pages using the passed variables. Obvioiusly I still need the passed parameters, but will this plugin prevent google from indexing my homepage under mutliple URLs ?

  88. Alex
    By Alex on 6 October, 2009

    Very nice!!! I had some problems with this in past and I didn’t know how to solve the problem. This means that now I have a solution for double content.

  89. koko
    By koko on 9 October, 2009

    Nice article, interesting news.

  90. cordless phones
    By cordless phones on 10 October, 2009

    So, in WordPress we leave the Canonical URL links ‘checked’ to prevent duplicate entries in the SERPS?

  91. AqarAqar
    By AqarAqar on 25 October, 2009

    GREAT JOB JOOST! I have struggled with link dilution for so long. Implemented the plug-in and
    can’t wait to see what it does to my PRs. Thank you!

  92. Mark Nolan
    By Mark Nolan on 29 October, 2009

    I want to inform you of an issue with Magento and the Yoast Canonical link extension in conjuction with another Magento extension AW blog.

    Please take a look at the following link:

    It should be like this:

    Can you offer any help/advice on how best to fix this?

  93. Liza C
    By Liza C on 6 November, 2009

    Hi! Just like them, I think that this is a great module for Drupal. However, I currently have the Global Redirect module installed and the module is just a modification of the GlobalRedirect. Should I overwrite or uninstalled the GlobalRedirect module then install this? Please advise on the best thing to do.

    On the side note, I feel that this will answer my problem on duplicate content generated by Views module results.

    This is actually the scenario

    I wanted these pages to have the top page ( canonical to succeeding pages in the archive. How can I apply the rel=”canonical” in this situation?

    Any help from anyone will be really appreciated. Thanks!

  94. daniambrosio
    By daniambrosio on 19 November, 2009

    I was testing your plugin and found a link on a site reporting that it is a bug it is a bug that is adding the tag only to the first alias created to the page. In my case, it seems to be the correct behavior. I created a post about it on my blog: Maybe the guy who wrote had other aliases that were not carrying the canonical tag. Anyone else had this issue?

    Best Regards!

  95. Stefan v V.
    By Stefan v V. on 30 November, 2009

    Hi everybody,

    I’m not sure if I understand this correctly: is there any formating of the canonical tag to be done in the magento store? Or is installing the extension sufficient?

    Sorry for being a dummy about this :)