New format
Canonical tag rel=canonical: how it works and how to set it
`rel="canonical"` tells search engines the preferred URL among available copies or near-variants of a page. It’s not a “delete duplicate” button — a preference signal that can be ignored when signals strongly conflict.
Below: syntax, why you need it for duplicates, absolute URL rules, how it differs from redirects and noindex, and common mistakes. Treat this as the main take on rel=canonical among related posts.
What the canonical tag is
The tag exists to tell search: “among these similar addresses, treat this one as primary.” Typical cases — sort parameters, sessions, https/www variants before merging, print versions, partial product-card duplicates.
Canonical doesn’t replace a clean URL structure and internal links. If the whole site links to crooked addresses, one tag in head won’t carry the fix.
Roles in short:
- canonical — preference among available URLs
- 301 — move; old URL shouldn’t live
- noindex — document not in the index
- robots Disallow — about crawl, not merging
How to set it: HTML and header
Basic form in `<head>`: `<link rel="canonical" href="https://www.example.com/catalog/item/">`. The URL should be the one you want in the index and, where possible, in snippets.
For PDFs and non-HTML responses use the HTTP header `Link: <https://...>; rel="canonical"`. On a CMS an SEO plugin field is usually enough — check it doesn’t spawn a second tag.
Rules of thumb:
- absolute https URL
- same host as the site canon (www or not)
- one tag per document
- canon returns 200, not a redirect chain
- internal links preferably point to the canon already
Why SEO needs it — and when the tag doesn’t save you
The goal is to gather signals (links, behavior, relevance) onto one URL and cut duplicate noise in the index. That’s hygiene — not a ranking boost overnight.
If there are no duplicates and URLs are clean — a self-reference is still useful as an anchor. If content is thin or pages differ in meaning, “everything to homepage” canonical hurts: you merge unrelated pages.
Good cases:
- UTM and ad parameters
- sorts / light filters with the same content
- www and https before a full merge
- AMP / alternate templates with the same meaning
Practice: typical setups
Online store: product card — canon on the clean URL without `?color=` if content is the same; if color is a separate entity with unique copy — its own canon on that card.
Pagination: don’t blindly fold every list page onto the first via canonical — follow current guidance and how it ties to `rel` prev/next / UI. Filters: indexing policy + canonical, or you get a thousand near-identical URLs.
Before rollout:
- pick one canon per entity
- update CMS templates
- check View Source / DevTools
- align sitemap and menu with canons
- monitor pages in search
Mistakes that break canonical
Blocking a duplicate in robots.txt and expecting canonical to work: the bot may see the tag worse. Putting noindex on the canon while copies point to it. Serving 4xx/5xx on the canonical URL. Sending every filter to the homepage “just in case.”
Conflict with hreflang: language versions should agree canons within a locale — not collapse all languages into one URL without a policy.
Bug checklist:
- several different canonicals in head
- broken relative paths
- canon to another domain without reason
- canon ≠ what’s in the sitemap
- OG / social meta pointing to another URL without need
Diagnosing problems
If the SERP shows the “wrong” URL — check: which canonical is in the code, where internal links go, any redirect chains, what’s in the sitemap. In Search Console / webmaster tools compare the bot-selected canon vs the one you declared.
Mass duplicates without tags, a canon pointing to a thin low-authority page, or an unavailable canon while the duplicate is open — typical reasons for “tag is there, no effect.”
Tools:
- crawler: canonical column
- spot View Source
- indexing reports in panels
- compare title/H1 across duplicate groups
FAQ
Does canonical remove a duplicate from the SERP?
Not always instantly and not like a 301. It states a preference. With conflicting signals the bot may choose otherwise.
When should I use a 301 vs canonical?
If the old URL shouldn’t open — 301. If both addresses are needed for people (filters, print, UTM landing) but one should be indexed — often canonical. See the redirects article.
Where should I put the canonical tag?
In HTML `<head>`: `<link rel="canonical" href="https://example.com/page/">`. Alternative — HTTP `Link` header with rel=canonical for non-HTML.
Can the canonical href be relative?
Prefer absolute with https and the final host. Relative paths more often break when templates are copied.
Can a page have several canonical tags?
No. One preferred. Several different ones — conflict and chaos for the bot.
Do you need a self-referencing canonical?
Often yes: it explicitly locks the page canon and helps with parameters and CMS templates.
Should I use canonical instead of noindex?
Different tools. noindex — “don’t index this document.” Canonical — “prefer that URL.” Don’t confuse with Disallow in robots.txt.
Does it help with full copy-paste from another site?
Weakly. External plagiarism is another story. Canonical mainly solves your internal URL variants.
Three different canonicals in head — and filters still in the index?
We’ll set one absolute https canon per entity — preference signal, not a fake 301.
Discuss the task