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:// and https://, www and 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/runner and /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:

MethodGoogle's descriptionUse it when
301 or 308 redirectStrong signalThe duplicate URL should not exist at all
rel="canonical" link element or HTTP headerStrong signalBoth URLs must keep working
Listing the URL in your sitemapWeak signalAlways, 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:

html
<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 a head broken 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" with hreflang, media or lang attributes. Google ignores canonical links that carry them; use rel="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?

Questions

Frequently asked.

Should every page have a self-referencing canonical?

Yes, on every page you want indexed. Google recommends it, and it protects the page against copies created by tracking parameters, alternate hostnames and scrapers. Most CMSs and SEO plugins add it automatically; check that it shows the full, final URL and not a staging or http version.

Is a canonical tag the same as a 301 redirect?

No. A redirect sends visitors and crawlers to the other URL; a canonical leaves both URLs working and asks Google to index one. Use a 301 when the duplicate should not exist at all. Use a canonical when both URLs must keep working, such as a URL with a tracking parameter.

Can a canonical point to a different domain?

Yes, Google accepts cross-domain canonicals, for example when the same article lives on two of your own sites. For syndicated content on partner sites, Google advises against relying on the canonical and recommends the partner blocks indexing of the copy instead.

Sohail Hussain

Founder, MSH Technologies

Sohail has designed and built websites, web apps and AI products for over 12 years, for clients from Singapore-based industrial groups to early-stage SaaS startups. He writes about what actually worked.

Keep reading

Related guides.

All posts

Your next move

Like what you see? Tell us about it.

A process that takes too long, a website that undersells you, or an idea ready to take shape. Tell us where you are and we will suggest a useful next step.

India · Working with clients worldwide

Sohail, Founder, replies within 1 working day (Mon–Sat, IST). Free and no obligation.