Canonical Tags: Fixing Duplicate Content Without Losing Rankings
The short version
- A canonical tag names the one URL that should represent a set of near-identical pages.
- It is a strong hint, not a command. Google can and does overrule it.
- Every page should have one, including the canonical page itself, pointing at itself.
- Use an absolute URL that matches exactly: right protocol, right host, right trailing slash.
Most duplicate content is accidental. Nobody sets out to publish the same page four times, but the moment a site has filters, tracking links, a print view or a careless server configuration, it happens anyway. The canonical tag is how you clean it up without deleting anything.
1. The problem it solves
Consider a single product page. Depending on how a visitor arrived, it might be reachable at all of these:
https://example.com/shoes/runner
https://example.com/shoes/runner/
https://www.example.com/shoes/runner
http://example.com/shoes/runner
https://example.com/shoes/runner?colour=blue
https://example.com/shoes/runner?utm_source=newsletter
To you that is one page. To a search engine those are six URLs that happen to return similar content. If three sites link to the plain version and two link to the newsletter version, your link value is split across addresses instead of pooling into one.
Google will try to work out which one you meant and group them itself. It is reasonably good at it. But guessing is not the same as knowing, and when it guesses wrong you get the wrong URL in results, or a page that never quite ranks as well as it should.
2. What the tag looks like
One line in the <head> of every version:
<link rel="canonical" href="https://example.com/shoes/runner">
Every one of those six URLs carries that same tag, naming the same preferred address. Google follows the pointers, groups the set, and treats the named URL as the real page. Signals from all six consolidate into it.
For files that have no HTML head, like a PDF, use the HTTP header instead:
Link: <https://example.com/report.pdf>; rel="canonical"
3. A hint, not an order
This is the part that surprises people. The canonical tag is a signal Google weighs alongside others: your internal links, your sitemap, redirects, and which version people actually link to. If those all point one way and your canonical points another, Google backs the weight of evidence.
Search Console reports this as Duplicate, Google chose different canonical than user. When you see it, the tag is not broken. You are being told your other signals contradict it. The fix is to make them agree: link internally to the canonical version, list only the canonical in your sitemap, and point redirects at it.
4. Self-referencing canonicals
Every indexable page should carry a canonical tag pointing at itself. This feels redundant and is not.
Without one, any URL with a tracking parameter tacked on is an unlabelled duplicate. Someone shares ?fbclid=abc123 on social media, that address gets crawled, and nothing on the page says which version is real. With a self-referencing canonical, the parameter version immediately identifies its own parent. You get this protection for free on every page, forever, for one line of markup.
5. Getting the URL right
Canonical tags fail quietly, so precision matters more than usual. Four rules:
- Absolute, not relative. Write the full
https://example.com/page. Relative paths are technically permitted and go wrong the moment the tag is served from an unexpected base. - Match the protocol and host exactly. If the site runs on https without www, the canonical must say https without www. Pointing at a URL that then redirects wastes the signal.
- Match the trailing slash.
/pageand/page/are different URLs. Pick the one your server actually serves and be consistent everywhere. - One per page. Two canonical tags on the same page cause Google to ignore both. This happens constantly on WordPress, where the theme adds one and an SEO plugin adds another.
6. Canonical, redirect, or noindex?
Three tools, three jobs, regularly confused:
| Situation | Use | Why |
|---|---|---|
| Both URLs must stay reachable by people | Canonical | Consolidates signals, keeps both usable |
| Old URL should no longer be used at all | 301 redirect | Stronger, moves visitors too |
| Page has no search value and no duplicate | noindex | Nothing to consolidate into |
| Same content in two languages | hreflang, self-canonical each | Not duplicates, alternates |
The key difference between canonical and noindex: canonical keeps the ranking value and moves it somewhere useful. Noindex discards it. Using noindex on a filtered product page throws away every link that page ever earned. Prefer canonical whenever a sensible target exists.
7. Pagination
Old advice said to use rel="next" and rel="prev". Google stopped using those in 2019, so do not spend time on them.
The current answer for a paginated series is simpler than it looks: each page self-canonicalises. Page two points at page two. Do not canonicalise page two to page one, because the products or posts on page two exist nowhere else, and canonicalising them away tells Google to ignore them entirely.
If a genuine view-all page exists and loads acceptably, canonicalising the paginated pages to it is reasonable. Otherwise leave them self-referencing.
8. Mistakes that break things quietly
- Every page canonicalising to the home page. A classic misconfiguration. It tells Google the entire site is one page, and everything else disappears from search. If traffic fell off a cliff after a redesign, check this first.
- Canonicalising to a redirecting URL. Chains confuse the signal. Point at the final destination.
- Canonicalising to a noindexed page. Contradictory. You are asking Google to consolidate into a page you also said to drop.
- Canonicalising to a blocked URL. Google cannot read the target, so it cannot confirm the relationship. See noindex vs disallow.
- Tag in the body rather than the head. Only the head counts. If JavaScript injects it late, it may be missed.
- Different canonicals in the HTML and the HTTP header. Pick one method.
9. How to check yours
Fastest check: open a page, view source, search for rel="canonical". Confirm there is exactly one, and that the URL is the one you expect.
Then run the page through URL Inspection in Search Console. It shows both the canonical you declared and the canonical Google selected. When those two disagree, you have found something worth fixing, and the reason is almost always inconsistent internal linking rather than the tag itself.
For a whole site, a crawler like Screaming Frog will list every page whose declared canonical differs from its own URL. Sorting that column is usually the quickest way to spot a template-wide mistake.