A canonical link tells search engines which version of a page is the "official" one when the same content appears at multiple web addresses

When you have the same content accessible from different URLs — whether by accident or by design — search engines get confused about which version to rank and send traffic to. A canonical link is a line of code you put in a page's HTML that says "this is the main version; treat the others as copies." It looks like this: <link rel="canonical" href="https://example.com/official-page">

Search engines like Google use canonical links to avoid penalizing you for duplicate content and to funnel ranking power to the version you actually want people to find. Without it, Google might rank the wrong URL, split your traffic between versions, or waste its crawling budget on duplicates instead of new pages.

Key Takeaways

  • A canonical link is a single line of HTML code that points search engines to the version of a page you want ranked and indexed.
  • Duplicate content across multiple URLs is common — from session parameters, sorting options, or intentional mirrors — and canonical links prevent search engines from treating them as separate pages.
  • Without a canonical link, Google may rank the wrong URL, split your traffic between versions, or waste crawling resources on duplicates.
  • You place the canonical tag in the <head> section of the page, and it should point to the version you want to be the primary one.

When duplicate content happens without you planning it

Many websites end up with the same content at different URLs without realizing it. An e-commerce site might have a product page accessible as example.com/shoes, example.com/shoes?sort=price, and example.com/shoes?color=red — all showing similar or identical content. A blog might be reachable with and without the www prefix, or both http and https versions might work.

Session IDs, tracking parameters, and printer-friendly versions create even more duplicates. From Google's perspective, these look like separate pages with the same content, which raises a red flag. The search engine has to decide: which one is real? Should I rank all of them? Should I penalize this site for spam?

A canonical link removes that guesswork. You're telling Google explicitly: "This one is the real version. Index and rank this one. Treat the others as references to it."

How canonical links affect your search rankings

Google consolidates the ranking signals — links, engagement, content quality — from all the duplicate URLs and applies them to the canonical version you've named. This means all the authority and traffic potential flows to one URL instead of being split across many.

Without a canonical link, Google might pick a version you didn't intend. It might choose the one with session parameters, or the non-secure version, or the one with extra tracking codes. That version then becomes the one that ranks and gets indexed, while your preferred URL stays invisible in search results.

Canonical links also save Google's crawling budget — the amount of time and resources Google spends crawling your site. Instead of crawling five versions of the same page, Google crawls the canonical version and the others just once or twice to confirm they're duplicates. This means Google has more budget left to crawl your new and updated pages.

Where to place a canonical link and what it should point to

The canonical tag goes in the <head> section of your HTML, not in the body. It looks like this:

<link rel="canonical" href="https://example.com/official-page">

The href should be the full, absolute URL of the version you want to be primary — not a relative path. If you're on a duplicate page, the canonical tag still points to the main version, not to itself. For example, if example.com/shoes?sort=price is a duplicate, its canonical tag points to https://example.com/shoes.

Every page can have only one canonical link. If you add multiple canonical tags to the same page, or point to different URLs, search engines ignore them or pick one at random, defeating the purpose.

Self-referential canonicals and when to use them

A page can point to itself as its own canonical — for example, example.com/shoes includes a canonical tag pointing to https://example.com/shoes. This seems redundant, but it's actually useful as a safety measure. It tells Google "this is definitely the main version" and prevents Google from accidentally treating it as a duplicate if the URL appears elsewhere on your site or in your logs.

Self-referential canonicals are especially common on large sites where the same content might be linked in multiple ways, or where you want to be absolutely clear about which version is primary. They add a small amount of code but remove ambiguity.

Canonical links versus redirects: which one to use

A redirect sends visitors and search engines from one URL to another automatically. A canonical link tells search engines the URLs are related but leaves both accessible. They serve different purposes.

Use a redirect when you want to permanently retire a URL — when you've moved a page, changed its name, or consolidated two pages into one. Visitors who land on the old URL get sent to the new one, and Google updates its index to reflect the change.

Use a canonical link when both URLs need to stay live — when you have intentional variations like a mobile version, a print version, or a page with different sorting options. The canonical link tells Google which one is primary without breaking the other versions.

If you redirect everything, you might break functionality or user experience. If you use only canonical links without redirecting, you might confuse visitors who land on the duplicate URL. Many sites use both: a canonical link on the duplicate page, plus a redirect for visitors.

Common mistakes with canonical links

The most frequent error is pointing the canonical link to the wrong URL — often a duplicate instead of the main version. This inverts the intended effect: Google treats your preferred URL as the duplicate and ranks the other one instead.

Another mistake is using relative URLs instead of absolute ones. A canonical tag with href="/shoes" instead of href="https://example.com/shoes" can confuse search engines, especially on subdomains or in complex site structures.

Some sites add canonical links to pages that don't have duplicates, which is harmless but unnecessary. Others add multiple canonical tags to the same page, which Google ignores. And some point canonical links across domains — for example, from a staging site to a production site — which can cause Google to index the staging site instead of the live one.

Frequently Asked Questions

Do I need a canonical link on every page?

No. You only need a canonical link when a page has duplicates accessible at different URLs. If a page is only reachable from one URL, a canonical link is unnecessary. However, adding self-referential canonicals to all pages is a safe practice on large sites and doesn't hurt.

Can I use a canonical link to point to another website?

Yes, but carefully. You can point to a canonical URL on a different domain if that's truly where the original content lives. However, Google may ignore cross-domain canonicals or treat them as a redirect signal. Use this only when you're syndicating content or have a legitimate reason to defer to another site's version.

What happens if I point a canonical link to a page that doesn't exist?

Google will follow the canonical link and find a 404 error. It may ignore the canonical instruction or treat the current page as the primary version. Always point canonical links to pages that actually exist and return a 200 status code.

Does a canonical link hurt my SEO if I use it wrong?

A canonical link pointing to the wrong URL can hurt your rankings because Google will rank and index the wrong page. However, a canonical link that points to a valid page — even if it's not the one you intended — won't cause a penalty. Google simply follows the instruction you gave it.

Can search engines ignore my canonical link?

Yes. Google treats canonical links as a strong suggestion, not a command. If Google thinks you've made a mistake — for example, if the canonical URL is on a different domain or returns an error — it may ignore the tag and make its own decision about which version to rank.