What is a canonical tag (rel=canonical) — and how do you set it right?
<link rel="canonical" href="…"> — that tells search engines which URL is the master, "official" version of a page when the same or very similar content is reachable at more than one address. It lives in the <head> of the page and points at the URL you want to rank. When duplicates exist (say, example.com/shoes and example.com/shoes?ref=newsletter show the same page), the canonical tag consolidates them into one, so search engines index and rank the version you chose instead of splitting the signals — or picking one for you.
The concept has a precise name — the canonical URL is the single address you've declared as authoritative for a piece of content. Everything else that shows the same content is a duplicate that should defer to it. Getting this right quietly prevents a whole class of SEO problems; getting it wrong can hide your pages from search entirely.
Why do duplicate URLs happen at all?
Most site owners never intend to publish the same page twice — but the web makes it easy to do by accident. The same content routinely ends up at several URLs because of:
- Tracking parameters:
?utm_source=…,?ref=…,?fbclid=…appended to links create new URLs that show identical content. - Protocol and host variants:
http://vshttps://, andwww.vs the bare domain, are technically four different URLs for one homepage. - Trailing slashes and casing:
/aboutvs/about/vs/About. - Sort, filter and pagination parameters on shop and listing pages:
?sort=price,?color=blue. - Printer-friendly or AMP versions, and syndicated copies of an article on another site.
To a search engine, each distinct URL is a candidate page. Without a signal telling it these are the same thing, it has to guess which one to index — and it may split ranking signals (links, relevance) across the duplicates or index the wrong one.
What does a canonical tag actually do?
It consolidates duplicates into one canonical URL. When Google finds a page whose <head> contains:
<link rel="canonical" href="https://example.com/shoes" />
…it treats that URL as the one to index and rank, and folds the ranking signals from any duplicate versions into it. The ?ref=newsletter copy stops competing with the clean URL; they're understood as the same page.
Two things it is not:
- It's not a redirect. A visitor on the duplicate URL still sees that URL in their browser — the canonical tag only speaks to crawlers. If you want humans and bots sent to one URL, that's a 301 redirect, not a canonical.
- It's a hint, not a command. Google usually respects a canonical tag, but treats it as one signal among several (internal links, the URL in your sitemap, redirects). If your signals contradict each other, it may pick a different canonical than the one you declared.
How do you set a canonical tag correctly?
The tag itself is simple; the mistakes are in the details. The rules that matter:
- Every indexable page should declare a canonical — even pages with no duplicates. On a page with no duplicates, it's self-referential: the page points at its own URL. This pre-empts parameter duplicates and settles the http/https/www question.
- Use one absolute URL, including the protocol and domain:
https://example.com/shoes, never/shoes. Relative canonicals are allowed but error-prone. - Point at the version you actually want indexed — https, your preferred host (
wwwor not — pick one and be consistent), and the clean URL without tracking parameters. - Be consistent with your other signals. The canonical URL should be the same one you list in your sitemap, link to internally, and (where relevant) 301-redirect toward. Contradictory signals are the main reason Google ignores a declared canonical.
- One canonical per page. Multiple
rel=canonicaltags on a page cause Google to ignore all of them. - Never canonicalize everything to the homepage. A common and damaging mistake is pointing every page's canonical at the site root — that tells Google your inner pages are duplicates of the homepage and shouldn't be indexed. Each page's canonical should point at that page's preferred URL.
You can check any page's canonical in seconds: open the page, view source (or open DevTools) and search for rel="canonical". If it's missing, or points somewhere unexpected, that's worth fixing. (On ShiftPress sites, canonical tags are generated automatically for every page and kept consistent with the sitemap, so these mistakes can't creep in.)
What goes wrong when it's set wrong?
Canonical mistakes are dangerous precisely because they're invisible — the page looks fine to a visitor, but tells search engines the wrong thing:
- Canonical points to a
noindexpage → the whole cluster can drop out of the index. - All pages canonical to the homepage → inner pages get treated as duplicates and quietly stop ranking.
- Canonical points to a broken, redirected, or blocked URL → the signal is confusing and often ignored, and consolidation fails.
- HTTP page canonicalizes to itself instead of the HTTPS version → you keep splitting signals across both.
Because none of these throw an error, they can sit unnoticed for months while traffic quietly leaks. That's why canonical tags belong on any SEO health check.
Frequently asked questions
What's the difference between a canonical tag and a 301 redirect?
A 301 redirect physically sends both users and crawlers from one URL to another — the old URL stops serving content. A canonical tag leaves both URLs live and reachable, and only tells crawlers which one to treat as authoritative. Use a redirect when a URL should truly go away; use a canonical when both URLs need to keep working (e.g. a product reachable via several filter paths) but only one should be indexed.
Should every page have a canonical tag?
Yes — including pages with no known duplicates, where it should point at the page's own URL (a self-referential canonical). It costs nothing, pre-empts duplicates created by tracking parameters, and removes ambiguity about your preferred http/https and www variant. Leaving it off just hands the decision to Google.
Does a canonical tag guarantee Google uses that URL?
No. Google treats the canonical as a strong hint, not an absolute instruction, and weighs it against your other signals — internal links, sitemap entries, redirects, and which version it finds more often. If those contradict your declared canonical, Google may choose a different one. Keeping all your signals pointing at the same URL is how you make the canonical stick.
Can a canonical tag point to a page on a different domain?
Yes — a cross-domain canonical is valid and is how syndicated content should be handled: a site that republishes your article can set its canonical to your original URL, so the ranking credit stays with you. The target must show the same (or very similar) content, or Google will ignore the tag.
Prefer to have this handled for you?
ShiftPress moves your website off WordPress and takes care of the technical details on this page — redirects, DNS, sitemaps, speed — while you change your site simply by asking.
Migrate my site ↗