What is a canonical URL?

As a website gets bigger, it’s often hard to prevent pages from becoming duplicates or near-duplicates of each other. This can cause duplicate content issues. If you have two similar pages, and they are both eligible to rank for a certain keyphrase, the search engine simply doesn’t know which of the two URLs it should send the traffic to. To solve this, you can select a preferred URL, this is what we call the canonical URL.

Same content, multiple URLs

You might, for instance, have a post or product that is attached to two categories and exists under two URLs, like so:

https://example.com/black-shoes/black-and-red-shoes/
https://example.com/red-shoes/black-and-red-shoes/

If these URLs are both for the same product, choosing one as the canonical URL tells Google and other search engines which one to show in the search results.

Canonicals also enable you to point search engines to the original version of an article. Let’s say, you’ve written a post for another party that is published on their website. If you’d like to post it on your site too, you could agree on posting it with a canonical to the original version.

How to detect a canonical URL

A canonical URL can be seen in the source of a webpage, by searching for rel="canonical". It is an element only the search engines see, your users won’t be affected by it.

a canonical in the source code

An example of a canonical in the source code of one of our posts: it refers to the original version of the article that was first published on another website.

When to redirect, when to use a canonical

Unlike with redirects, users don’t see your canonical. If you can redirect a URL without breaking your site. You should. But if redirecting makes your site illogical, setting the canonical is a viable solution.

Want to learn more? Read our Ultimate guide to canonical URLs.


10 Responses to What is a canonical URL?

  1. Priscilla
    Priscilla  • 3 weeks ago

    Hi!
    I’ve written quite some blogpost for another website that I’m planning to share on my website as well. To prevent duplicate content penalties I should use canonical urls I think.

    My question is just;
    If I do that, will my readers automatically be directed to this other website? Or is it really something invisible and people will stay on my website, without even knowing about the url?

    Another question; do lots of canonical urls to another website cause you to rank less high in Google? I have loads of different content also. Just one section in particular I’ll duplicate post written by myself, but previously published on another website.

    Hope to hear your answers :)!

  2. Sofisuhail
    Sofisuhail  • 3 weeks ago

    If I write the article and it gets matched with the url of the previously published article. Does your plug-in suggest for change or not notify us.

  3. Inês
    Inês  • 4 weeks ago

    Hi Mr. Joost de Valk! Can I have a hallelujah right now? I don’t have a programming background – only the basic level -and I’m new in SEO world. These little details were information that I was looking for in every blog post about this theme. I wanted to know how can I make a canonical URL, which HTML code do I have to use? now, I know I will type .
    Thank you yoast!

  4. Raj Singh
    Raj Singh  • 4 weeks ago

    Great post,
    URL Canonicalization seems to be a quite new topic to me, being a newbie. Although I have read some guides, still I have one confusion, Do I need to add the URL Canonical Tag to every page of my site?

    • Inês
      Inês  • 4 weeks ago

      Hi Raj! I’m also new in this SEO world, but I think I know how to answer your question. You don’t need to add canonical tags to every page of your site, you should use only to avoid duplicate content. The example above about red shoes and when you want to write about a specific topic with a keyword that you are already ranking for. With canonical URL you’ll avoid the problem about competing with yourself in the search engine.

  5. Andy
    Andy  • 1 month ago

    On some WordPress themes, they are built with cool animations on the landing/homepage but only for posts. Could we create posts – which look and act just like pages – to take advantage of these and then redirect or would it be best to just canonicalize them to actual page so that duplicate content is avoided?

  6. roospm65
    roospm65  • 1 month ago

    @Joost,
    With regards to a self-referencing canonical URL: You have said about inserting self-referencing canonical URL’s. “If you don’t do it yourself, someone else could do it to you and cause a duplicate content issue” … how is it possible for that “someone else”, to cause duplicate content issue?

  7. healthcaretipsonline
    healthcaretipsonline  • 1 month ago

    how to find free SEO for beginners course, what do

    • Willemien Hallebeek
      Willemien Hallebeek  • 1 month ago

      Hi! Here you’ll find our free SEO for Beginners course: https://yoast.com/academy/free-seo-training-seo-for-beginners/ Enjoy!!!

      • Gracious Store
        Gracious Store  • 4 weeks ago

        In an E commence website, to avoid duplicate content, can you direct the canonical URLs of each product page to the category page the products belong?


Check out our must read articles about SEO Basics