Website technology
What is a canonical tag? Definition and how it prevents duplicate content
Canonical tags tell a search engine which URL should be treated as the original when the same content is reachable at several addresses. The tag is a strong signal, not a command: Google collects it alongside other evidence and still makes its own choice about which URL represents the content.
Last reviewed August 29, 2026 · 6 min read
On this page
Google calls the underlying process canonicalization — selecting the representative URL for a piece of content, often called deduplication. When it finds pages whose primary content looks the same, it clusters them and picks the one it judges most complete and useful. That page is then crawled most regularly; the duplicates are crawled less often.
Why the same page ends up on several URLs
Almost nobody creates duplicates on purpose. They arrive on their own:
- Protocol and host variants —
http://andhttps://,wwwand non-www, all resolving without a redirect. - Tracking parameters —
?utm_source=…, ad click IDs, affiliate tags appended to a working URL. - Trailing slashes and casing —
/pricingand/pricing/,/Pricingand/pricing. - Filters and sorting — the same product list at
?sort=price,?colour=blue, and twenty combinations of both. - Print, AMP, or preview versions of an article that stayed reachable.
- Syndication — your article republished on a partner site, with theirs sometimes indexed instead of yours.
Moz makes a point worth repeating here: duplicate content is not technically a penalty, but it still costs rankings, because the engine has to choose one version and the signals that should have gone to one URL are spread across several.
How Google decides, and how you influence it
Google's documentation lists the ways you can express a preference, in order of how strongly they influence the outcome:
| Method | Strength | Notes |
|---|---|---|
| Redirect | strong | The clearest statement: this URL is that URL now. |
rel="canonical" annotation |
strong | In the HTML head or as an HTTP header — pick one, not both. |
| Sitemap inclusion | weak | Helps included URLs become canonical; not a fix on its own. |
They stack. A canonical annotation plus a sitemap that lists only canonical URLs plus consistent internal linking is far more convincing than any of the three alone. And where a duplicate genuinely has no reason to exist, the redirect is the better tool — canonical tags are for URLs that must stay reachable.
The annotation itself is a <link rel="canonical" href="…"> element in the head of every duplicate, pointing at the chosen page. Google's own guidance is to place a self-referential canonical on the canonical page too, so that every URL in the set states the same answer.
Rules that keep it from going wrong
One method, not two. Providing the canonical both in the HTML and in an HTTP header is supported but error-prone — Google's docs specifically warn that you may end up naming different URLs in each.
Do not use noindex to pick a canonical inside one site. It completely blocks the page from Search rather than consolidating it, and the canonical annotation is the preferred solution. Combining noindex with a canonical pointing at another page is a well-worn way to remove a page you wanted to keep — how that interacts with the index is covered under crawling and indexing.
Do not canonicalize language variants to each other. A German and an English version of the same page are alternates, not duplicates; that relationship belongs in link rel="alternate" hreflang annotations, and each language version should be its own canonical.
No URL fragments. Google generally does not support fragments as canonical targets, so #section in a canonical href is wasted.
Keep the signals consistent. If your canonical says one URL, your sitemap lists another, and your internal links point at a third, you have not expressed a preference — you have expressed confusion, and the engine will resolve it for you.
Where canonical tags actively cause damage
Three failure modes account for most of the harm we see in audits.
The first is the blanket canonical: a template that points every page at the home page, usually because someone hardcoded the tag once. It is a request to have the entire site deindexed except one URL, and it is astonishingly common after a relaunch.
The second is the canonical that contradicts a redirect — page A redirects to B while B's canonical points back at A. The engine resolves the loop by ignoring you.
The third is canonicals injected by JavaScript. If the tag only exists after client-side rendering, it depends on the rendering pass happening at all before the page's canonical is decided. Server-rendered HTML settles the question; a headless CMS setup that renders on the client leaves it open.
How Xerx does this
Canonicals sit in the part of our work that clients rarely ask for by name and that decides a surprising amount: technical SEO. In an audit we crawl the site the way a search engine does, then compare what the templates claim against what Search Console reports as the selected canonical — those two disagreeing is one of the most reliable early symptoms of a broken relaunch.
We fix it in the codebase rather than in a recommendations document. On the sites we build, the canonical is generated by the routing layer, not typed into a plugin field: one URL shape per page, self-referential canonicals everywhere, tracking parameters excluded, and language variants wired as hreflang alternates instead of duplicates. That is also how this site is built.
The diagnosis costs nothing — the free SEO report covers the technical essentials, canonicals included. Ongoing work runs inside SEO Care from €790 per month with real, logged hours, cancel monthly. If the honest finding is that your canonicals are fine and your problem is elsewhere, that is what the report will say.
FAQ
Is a canonical tag a directive or a hint?
A hint, and a strong one. Google treats rel="canonical" as a strong signal but combines it with redirects, internal links, sitemaps, and its own assessment of which page is most complete — so it can pick a different URL than the one you named. When that happens, the answer is rarely to shout louder with the tag; it is to make the other signals agree with it.
Should a page have a canonical tag pointing to itself?
Yes, in almost all cases. Google recommends including a self-referential canonical on the canonical page, and the practical benefit is bigger than the theory: it means any URL variant that appears with parameters appended still carries a tag naming the clean address. It costs nothing and removes a whole class of accidental duplicates.
Does duplicate content get my site penalised?
No. Having the same content on several of your own URLs is not a spam violation and does not trigger a manual action — Google's own starter documentation says as much, and Moz makes the same point. What it does is waste crawl budget and split the signals that should be concentrated on one page. The cost is dilution, not punishment; copying other people's content is a different matter entirely.