Skip to main content
Skip to main content
Technical SEO
Last reviewed: November 1, 2026

Canonical Tag Guide: How rel=canonical Works

Use rel=canonical to consolidate duplicate URLs: correct markup, HTTP header canonicals, signal strength, and common implementation mistakes.

Quick answer

A canonical tag is a link element, rel="canonical", placed in the head of a page to name the preferred URL among duplicates or near-duplicates. Google treats it as a strong hint, not a rule, and weighs it with redirects, sitemaps, and internal links. Use absolute URLs, add a self-referencing canonical, and keep every signal pointing at the same URL.

Perfect SEO Tools Team
8 min read

The same content often resolves at several URLs: with and without www, with tracking parameters, through filtered category paths, or as a printer-friendly copy. Google groups those duplicates and picks one representative URL to show in search results. That process is called canonicalization, and the canonical tag is the most direct way to state which URL you want chosen.

This guide follows Google's canonicalization overview and guide to consolidating duplicate URLs.

What the canonical tag is#

The canonical tag is a link element with rel="canonical". It goes in the <head> of each duplicate and points to the preferred URL:

<head>
  <title>Green dresses</title>
  <link rel="canonical" href="https://www.example.com/dresses/green-dresses" />
</head>

Google only accepts the element when it appears in the <head>. A canonical inside the <body>, often the result of a template that injects it into the wrong slot or invalid markup that closes the head early, is ignored.

A hint, not a command#

Google states that "indicating a canonical preference is a hint, not a rule." It weighs several signals to decide which URL is canonical, including whether the page is served over HTTPS, redirects, sitemap inclusion, and rel="canonical" annotations. When those signals disagree, Google may select a different URL from the one you declared.

Google ranks the methods you control by strength:

MethodStrengthBest use
Permanent redirectStrongRetiring a duplicate URL completely
rel="canonical" link or headerStrongDuplicates that must stay reachable, such as parameter or filtered URLs
Sitemap inclusionWeakSuggesting canonicals across a large site

The signals stack, so the most reliable setup aligns all three: the canonical URL is the redirect target, the value in every rel="canonical", and the only version listed in the sitemap.

Implementation rules#

Use absolute URLs. Google recommends absolute paths such as https://www.example.com/dresses/green-dress.html rather than /dresses/green-dress.html. Relative values break easily when a page is served from another host or protocol.

Add a self-referencing canonical. Google recommends a rel="canonical" link on the canonical page itself. It costs nothing and protects the page when tracking parameters or session IDs create unplanned copies.

Set it in the HTML source. Google asks that the canonical be present in the server-rendered HTML and that JavaScript not change it. If you can only set it with JavaScript, set it once and do not overwrite a server-provided value.

Keep one canonical per page. Plugins, themes, and frameworks can each emit their own tag. Two conflicting canonicals make the signal unreliable, so view the rendered source and confirm only one remains.

Canonicals for PDFs and other files#

Non-HTML files have no <head>, so send the canonical as an HTTP response header. Google supports this for web search results:

Link: <https://www.example.com/downloads/white-paper.pdf>; rel="canonical"

This is useful when the same PDF is served from a CDN path and a site path, or when an HTML page and its PDF version carry the same content.

Mistakes that split signals#

  • Blocking duplicates in robots.txt. Google cannot read the canonical on a page it is not allowed to crawl, and it "may still index URLs that are disallowed in robots.txt without their content." Let duplicates be crawled so the canonical can be seen. Our robots.txt guide covers what crawl blocking does and does not control.
  • Using noindex to choose a canonical. Google advises against using noindex to steer canonical selection within one site. Use rel="canonical" or a redirect.
  • Mixing methods that disagree. A sitemap that lists one URL while the page's canonical names another sends opposite signals. Google warns against naming different canonicals for the same page through different techniques.
  • Canonicalizing to a redirect, 404, or noindexed page. The target should return 200, be indexable, and declare itself canonical.
  • Pointing every paginated page to page one. Page two of a category lists different items than page one, so it is not a duplicate. Google's pagination guidance says not to use the first page as the canonical for the sequence; give each page its own canonical URL.
  • Using the URL removal tool. Google notes that it hides all versions of a URL from Search, not just the duplicate.

Language versions and hreflang#

Translated pages are not duplicates of each other. Google considers language versions duplicates only "if the primary content is in the same language," so a German page should not canonicalize to its English equivalent. Each language version gets a self-referencing canonical in its own language, and hreflang annotations connect the set. Google also notes that rel="canonical" links carrying hreflang, lang, media, or type attributes are not used for canonicalization.

Our canonical and hreflang tag manager prepares both sets of tags so they stay consistent.

How to check which URL Google chose#

Open the URL Inspection tool in Search Console and inspect a duplicate. Its indexing details show the user-declared canonical next to the Google-selected canonical. When they differ, look for conflicting signals: internal links pointing at the duplicate, a sitemap listing the wrong version, redirects that point elsewhere, or a canonical target that is thinner than the duplicate.

Canonical checks belong in every crawl review. The technical SEO audit guide shows where they fit with redirects, sitemaps, and indexing checks.

Don't Miss Our SEO Updates

Get the latest SEO tools and strategies delivered to your inbox.

No spam, unsubscribe anytime. We respect your privacy.

About the Author

The Perfect SEO Tools team consists of experienced SEO professionals, digital marketers, and technical experts dedicated to helping businesses improve their search engine visibility and organic traffic.

Related Articles

Technical SEO

Google Search Console Crawl Stats Report: Diagnose Crawl Budget

How to audit the Google Search Console Crawl Stats report to spot 5xx host failures, faceted parameter traps, and discovery vs refresh bottlenecks.

10 min read
Technical SEO

Hreflang Tags Guide: HTML, HTTP Headers, Sitemaps & x-default

How to implement hreflang annotations for multilingual and multi-regional sites: ISO language and region codes, bidirectional return links, and canonicals.

11 min read
Technical SEO

Robots.txt Guide: Syntax, Rules, and AI Crawlers

How robots.txt controls crawling: file location, rule matching, wildcards, error handling, and the user-agent tokens AI crawlers publish.

9 min read