Canonical tags explained: what they do and when Google ignores them
A canonical tag tells Google which URL is the main version of a page. How it works, where it goes, common mistakes, and why Google may choose another URL.
By Sohail Hussain21 November 20265 min read
A canonical tag is a line in a page's head, <link rel="canonical" href="https://www.example.com/page">, that tells Google which URL is the main version when the same content is reachable at several addresses. Google treats it as a strong hint, not an instruction. Put a self-referencing canonical on every page you want indexed, point duplicates at the main URL, and make sure your redirects, sitemap and internal links all agree with it. When they disagree, Google often picks a different URL.
Canonical checks are part of every audit in our technical SEO and performance work, because a wrong canonical can quietly remove a page from search while everything else looks fine.
What problem does a canonical tag solve?
Most sites serve the same page at more than one URL without anyone deciding to. Common sources:
http://andhttps://,wwwand non-www- With and without a trailing slash, or in different letter case
- Tracking parameters:
?utm_source=newsletter,?gclid=...,?fbclid=... - Sort and filter parameters on category pages:
?sort=price,?colour=blue - Print versions, AMP versions, separate mobile URLs
- The same product in two categories:
/shoes/runnerand/sale/runner
Google groups these duplicates into a cluster and picks one URL to show in results. Google's own canonicalization overview says some duplicate content is normal and is not a spam problem. The reasons to declare a canonical yourself are practical: you choose which URL appears in search, links to any version count toward one URL, your reports show one set of numbers, and Google spends less time crawling copies.
How strong is a canonical compared with other signals?
Google lists the methods in order of influence in its guide to specifying a canonical URL:
| Method | Google's description | Use it when |
|---|---|---|
| 301 or 308 redirect | Strong signal | The duplicate URL should not exist at all |
rel="canonical" link element or HTTP header | Strong signal | Both URLs must keep working |
| Listing the URL in your sitemap | Weak signal | Always, for the canonical version only |
The signals stack. A page that is the redirect target, carries a self-canonical, is the one in the sitemap and is the one every internal link points to will almost always be chosen. A page with a canonical tag contradicted by everything else may not.
Google also lists what not to use for canonicalization: robots.txt (blocked URLs can still be indexed), the URL removal tool (it hides all versions), and noindex within a single site (it removes the page from search instead of consolidating it).
How do you add one correctly?
In the HTML head of each page:
<link rel="canonical" href="https://www.example.com/services/web-design/" />
The rules that matter:
- Use the full absolute URL, including protocol and host. Google supports relative URLs but advises against them, because a staging copy then canonicalises to itself.
- Put it in the
head. Google only accepts the element there, so aheadbroken by invalid HTML can hide it. - One canonical per page. Two conflicting tags, usually from a theme and a plugin, send mixed signals, and Google may ignore both.
- For PDFs and other files, send it as an HTTP header:
Link: <https://www.example.com/guide.pdf>; rel="canonical". - Do not combine
rel="canonical"withhreflang,mediaorlangattributes. Google ignores canonical links that carry them; userel="alternate"for language versions.
Platforms handle most of this for you. WordPress SEO plugins add a self-referencing canonical to every post and page. In Next.js, set alternates.canonical in the page's metadata, with metadataBase defined in the root layout so relative paths resolve to full URLs. Shopify themes output a canonical that points product URLs inside collections back to the main product URL. If you are adding tags by hand, our canonical tag generator builds a correct one for any URL.
Why does Google sometimes ignore your canonical?
Search Console reports it as "Duplicate, Google chose different canonical than user" in the Page indexing report. Inspect one of the URLs: URL Inspection shows the user-declared canonical next to the Google-selected one.
The usual causes:
- The pages are not duplicates. If the canonical points to a page with different content, Google treats the hint as a mistake and indexes both, or picks its own.
- Your other signals point elsewhere. The sitemap lists the other URL, internal links use the other URL, or a redirect goes the other way.
- The canonical target is broken. It redirects, returns 404, or carries
noindex. - JavaScript changes it. The HTML says one URL and a script rewrites it. Google's guidance is to set it in the HTML and leave it alone, or set it only with JavaScript, never both.
- Hreflang points to non-canonical URLs on a multilingual site.
Fix the cause, then request indexing for the most important URL. Google's troubleshooting guide notes it can keep pages clustered for up to two weeks after you make them clearly different.
Which canonical mistakes cause the most damage?
Every page canonicalised to the homepage. A template bug sets the canonical to the site root on every page. Google may follow the hint and drop the inner pages. Check three or four page types after every launch.
Paginated pages canonicalised to page one. Google's pagination guidance says not to do this: give page 2, 3 and so on their own canonical URLs, or the products and posts listed only on later pages lose a path to discovery.
A staging or old domain in the canonical. A site moves from staging.example.com or from an old domain, and the canonical still names it. Google is being told to index a site that no longer exists.
Canonical plus noindex on the same page. One signal says "index the other URL", the other says "index nothing". Pick one: canonical if the page is a duplicate, noindex if it should never be in search.
Canonical to a redirected URL. After a migration, canonicals still point at old URLs that now 301. Point them at the final destination. 301 vs 302 redirects and how to fix redirect chains cover the redirect side.
For the wider set of duplicate URL causes and the right fix for each, read duplicate content: causes and fixes. Canonicals are one of the indexing checks in our technical SEO checklist; if a page still is not indexed after its canonical is right, why your pages are not indexed covers the other reasons.
Was this guide useful?