TechnicalSEO

Canonical Tag: How rel=canonical Really Works

A canonical tag is a line of HTML, <link rel="canonical" href="...">, that tells search engines which URL is the main version of a page when the same content lives at several addresses. It consolidates duplicate URLs so links and ranking signals gather on one page instead of splitting across copies. It is also the most misunderstood tag in technical SEO, because Google treats it as a strong suggestion rather than an order.

This guide is for site owners, marketers and developers who need to set canonicals correctly or work out why Google ignored theirs. It covers the syntax, when to use a canonical instead of a redirect or noindex, cross-domain use, the mistakes that break it, and how to check what Google actually picked.

On this page

What a canonical tag looks like

A canonical tag is a single link element in the page’s <head> that names the preferred URL with an absolute address. Google’s guide to consolidating duplicate URLs sets out four rules for it: use absolute URLs rather than relative paths, place it in the <head>, include one on the canonical page itself, and don’t send conflicting canonicals through different methods.

<link rel="canonical" href="https://example.com/shoes/" />

For files that have no <head>, such as PDFs, the same instruction can travel as an HTTP response header. It is rare on HTML pages: the 2024 Web Almanac found it on only 1% of mobile pages. The header form looks like this:

Link: <https://example.com/guides/sizing.pdf>; rel="canonical"

The diagram below labels the parts of the tag and shows where it sits among the other ways of stating a canonical preference.

Anatomy of a canonical tag and how strongly each canonical method influences Google Top: the tag link rel equals canonical href equals https example.com shoes, annotated. The rel value is the hint, the URL must be absolute, and there should be one tag inside the head. Bottom: Google lists canonical methods in order of strength. Redirects are a strong signal, rel canonical link annotations are a strong signal, and sitemap inclusion is a weak signal. All are hints, and Google may still choose a different canonical based on content quality and other signals. Anatomy of a canonical tag One line in the head of the duplicate page, pointing at the version you want indexed <link rel="canonical" href="https://example.com/shoes/" /> one tag, inside <head> rel="canonical" is the hint absolute URL, never relative How strongly each method influences canonicalization Redirect strong signal rel="canonical" strong signal Sitemap inclusion weak signal All three are hints. Google can still pick another URL based on content quality and other signals.

Scroll the diagram sideways to see all of it.

Source: Ambeltek diagram based on Google Search Central, "How to specify a canonical URL with rel=canonical and other methods".

None of this is mandatory. Google says outright that a site “will likely do just fine without specifying a canonical preference”, because it can pick a representative URL on its own. You set canonicals to make that choice predictable, not to unlock rankings. Most sites do: the same Almanac found canonical tags on 65% of mobile and 69% of desktop pages in 2024.

Is the canonical tag a directive or a hint?

The canonical tag is a hint. Google’s canonicalization overview says indicating a canonical preference “is a hint, not a rule”, and lists the signals it weighs together: whether a page is served over HTTP or HTTPS, redirects, sitemap inclusion and rel="canonical" annotations.

In practice that means three things:

  • Agreement wins. When the tag, your internal links, your sitemap and your redirects all name the same URL, Google almost always follows you.
  • Contradiction loses. A canonical pointing at URL A while every internal link and the sitemap point at URL B invites Google to overrule the tag.
  • Only duplicates qualify. A canonical between two pages that are not substantially the same is not a canonical, it is a request Google has no reason to honor.

That last point is the one most people miss. The Search Console help for the Page indexing report puts it bluntly: if the declared canonical is not similar to the current page, Google “won’t ever choose that URL as canonical”.

When should you use a canonical tag?

Use a canonical tag when two or more URLs must stay reachable but show the same main content. Google’s own list of reasons duplicates exist maps neatly onto the jobs a canonical does:

  • Site functions: sorted and filtered lists, such as /shoes/?sort=price, which show the same products as /shoes/.
  • Tracking and session parameters: campaign tags and session IDs that create new URLs for the same page.
  • Protocol and host variants: http:// and https://, www and bare domain. Redirects are the better fix here, with a canonical as backup.
  • Device variants: separate mobile URLs pointing to the desktop canonical.
  • Region variants in one language: near-identical US and UK pages, which also need hreflang annotations so the right one is served.
  • Accidental copies: demo or print versions left accessible.

Add a self-referencing canonical to every indexable page as a default. It costs nothing and it protects the page when someone links to it with parameters attached. For the wider picture of why duplicates happen and what they actually cost, see our guide to duplicate content SEO.

Canonical vs noindex vs redirect vs robots.txt

Each of these tools solves a different problem, and using the wrong one is the root of most canonical trouble. The table compares them.

ToolWhat it tells GoogleVisitors still reach the URL?Consolidates signals?Use it for
301 or 308 redirectThe content moved for goodNo, they are forwardedYes, strongest signalRetired URLs, host and protocol variants
rel="canonical"Index the other URL insteadYesYes, strong signalSort orders, parameters, near-identical variants
noindexDon’t index this page at allYesNoThank-you pages, internal search results
robots.txt DisallowDon’t crawl this pathYesNoInfinite filter and calendar spaces

Google’s documentation is explicit about the two misuses: don’t use robots.txt for canonicalization, and don’t use noindex to steer canonical selection. A blocked page can’t be crawled, so Google never sees its canonical tag. A noindex page is dropped from the index rather than folded into the preferred one. If you are moving content, a proper redirect is the cleaner fix, covered in our guide to redirects and SEO.

The decision tree below turns the table into three questions.

Decision tree for choosing between a redirect, robots.txt and a canonical tag Start: do visitors need both URLs? If no, 301 redirect the copy to the main URL. If yes, ask: is it one of many filter or sort URLs from faceted navigation? If yes, disallow the pattern in robots.txt. If no, add rel canonical pointing to the main URL. Footer: don't use noindex, robots.txt or the URL removal tool to pick a canonical. Which fix for a duplicate URL? Two questions settle most cases Do visitors need both URLs? No Yes 301 redirect the copy to the main URL Is it one of many filter or sort URLs (faceted navigation)? Yes No Disallow the pattern in robots.txt rel="canonical" to the main URL Don't: use noindex, robots.txt or the URL removal tool to choose a canonical.

Scroll the diagram sideways to see all of it.

Source: Ambeltek diagram based on Google Search Central guidance on consolidating duplicate URLs and managing faceted navigation.

The faceted navigation branch comes from Google’s guide to managing crawling of faceted navigation URLs, which calls robots.txt and URL fragments the more effective options for filter spaces and says canonical tags “may, over time, decrease the crawl volume” of filtered URLs but are “generally less effective in the long term”. If crawl volume is the real worry, read our explainer on crawl budget first.

Cross-domain canonicals and syndication

A canonical tag can point to a URL on a different domain, and Google processes it the same way. The common legitimate use is running two sites that share content, such as a brand site and a regional store, where one version should rank.

Syndication is the exception people get wrong. It used to be standard advice to ask partners who republish your articles to add a cross-domain canonical back to you. Google’s canonicalization troubleshooting guide now says the canonical link element isn’t recommended for this, “because the pages are often very different”, and that the most effective fix is for partners to block indexing of the syndicated copy. The partner’s page carries its own navigation, ads and related links, so it is no longer a true duplicate of yours.

For your own multi-regional sites, the rule from Google’s multi-regional guidance is to pick a preferred version for any same-language duplicates and use rel="canonical" together with hreflang. Never point every regional page’s canonical at one “main” country version; that tells Google the other regions are copies not worth indexing.

Common canonical tag mistakes

Most broken canonicals come from templates, not from people typing the tag wrong. These are the mistakes we find most often in audits:

  1. Canonical pointing at a redirect or a 404. The tag should name a live, indexable, 200-status URL. Chaining a canonical to a redirect sends mixed signals.
  2. Relative URLs. A path such as /shoes/ with no protocol or host breaks when the page is served on a staging host or an alternate domain. Google’s guide asks for absolute URLs.
  3. Every page canonicalized to the homepage. A template default that tells Google the entire site is a copy of one page.
  4. Paginated series canonicalized to page one. Page 2 of a category lists different products from page 1, so it is not a duplicate.
  5. Canonical and noindex on the same page. One says “index the other URL”, the other says “index nothing”. Pick one.
  6. Conflicting signals. The tag says one URL while the sitemap, internal links and hreflang all use another. Google may overrule the tag.
  7. Canonicals changed by JavaScript. Google’s JavaScript SEO basics warns against using JavaScript to change the canonical to something different from the one in the original HTML. The Almanac found rendering changed the raw HTML canonical on 2.1% of mobile pages. Crawlers that don’t render JavaScript never see the change at all, which is a wider problem covered in JavaScript rendering and AI crawlers.
  8. More than one canonical tag. Plugins and themes that each inject their own tag leave Google with two answers.
  9. A URL fragment as the canonical. Google’s guide lists #section canonicals among the things not to do.

How do you check which canonical Google chose?

Inspect the URL in Search Console and compare two fields: the “User-declared canonical” (what your tag says) and the “Google-selected canonical” (what Google indexed). If they match, the tag is working. If they differ, the Page indexing report will usually file the URL under “Duplicate, Google chose different canonical than user”.

The diagram shows what happens between your tag and that report.

How Google groups duplicate URLs and selects one canonical Three duplicate URLs, http example.com shoes, shoes with a sort parameter, and an uppercase Shoes path, feed into a duplicate cluster where Google groups near-identical pages. The cluster is judged on signals weighed together: redirects, rel canonical, sitemap inclusion, HTTPS, and content quality. The result is the Google-selected canonical, the one URL indexed and shown. Compare it with the user-declared canonical in URL Inspection. After a fix, pages can stay clustered for up to two weeks. From duplicates to one indexed URL Your tag is one input to the choice, not the choice itself http://example.com/shoes /shoes/?sort=price /Shoes/ Duplicate cluster Google groups pages whose main content is the same or near-identical Signals weighed together redirects and rel="canonical" sitemap inclusion HTTPS over HTTP content quality, other signals Google-selected canonical: the one URL indexed and shown Compare it with the user-declared canonical in URL Inspection. After a fix, pages can stay clustered for up to two weeks.

Scroll the diagram sideways to see all of it.

Source: Ambeltek diagram based on Google Search Central canonicalization and canonicalization troubleshooting documentation.

When Google overrules you, work through the causes in order:

  • Are the pages really duplicates? If the declared canonical isn’t similar, Google won’t pick it. Either make the pages distinct or point the canonical somewhere that is a genuine match.
  • Do the other signals agree? Check internal links, the XML sitemap, redirects and hreflang for a different URL.
  • Is something injected? Google’s troubleshooting guide lists hacked sites with injected cross-domain canonicals and server misconfigurations among the causes.
  • Is the fix recent? Google says it may hold pages in a duplicate cluster for up to 2 weeks after content issues are fixed, and that clusters split faster when the difference is “clear and significant”. Change one thing, then wait.

Google also keeps track of canonical status in places you can’t see. In the 2024 leak of Google’s internal API documentation, more than 2,500 pages of it by SparkToro’s count, reported by iPullRank, the module that validates hreflang clusters stores a field called IndexingDupsLocalizedLocalizedClusterTargetLinkTargetDocData.isCanonical, described as whether the URL being validated is canonical at the time of processing. Google stores this attribute; the leak does not show how much it is weighted. It does suggest why a non-canonical URL makes a poor hreflang target.

For a walkthrough of the inspection tool and the reports mentioned here, see our Google Search Console guide.

Getting canonicalization right on your site

Canonical problems rarely announce themselves. Traffic drifts to the wrong URL variant, a category page stops ranking because its canonical points at page one, or Google indexes the parameter version of your best product. The fix is almost always consistency: one preferred URL per piece of content, stated the same way in the tag, the sitemap, the internal links and the redirects.

Start with a crawl that exports every page’s declared canonical next to its status code, then compare a sample against the Google-selected canonical in Search Console. Canonicals also sit inside a larger set of technical checks, listed in our technical SEO checklist for AI search. If you’d rather have someone map every URL variant and tell you which signals disagree, our AI visibility audit includes a full canonicalization review alongside crawl, indexing and AI-crawler access checks.

Frequently asked questions

What is a canonical tag in SEO?

A canonical tag is a link element in a page's head, written as rel="canonical", that names the URL you want search engines to treat as the main version of a piece of content. It is used when the same or very similar content is reachable at more than one URL, so ranking signals gather on one address instead of several.

What is a self-referencing canonical tag?

It is a canonical tag on a page that points to that page's own URL. Google's documentation recommends putting one on the canonical page itself, because it confirms the preferred address when parameters, tracking codes or alternate hostnames create copies of the URL.

Does Google always follow the canonical tag?

No. Google calls a canonical preference a hint, not a rule. It weighs rel=canonical alongside redirects, sitemaps, HTTPS and content similarity, and it can pick a different URL if those signals disagree or if the pages are not actually duplicates.

How can I check if a URL has a canonical tag?

View the page source and search for rel="canonical" inside the head, or check the response headers for a Link header with rel="canonical". To see what Google actually chose, inspect the URL in Search Console and compare the user-declared canonical with the Google-selected canonical.

Should I use a canonical tag or a 301 redirect?

Use a 301 redirect when visitors no longer need the duplicate URL, because a redirect is the strongest canonical signal and also moves people. Use a canonical tag when both URLs must stay reachable, such as a sorted product list or a URL with tracking parameters.

Can a canonical tag point to another domain?

Yes. Cross-domain canonicals are supported, and alternate URLs do not have to sit on the same domain. For content syndicated to partner sites, though, Google now advises that partners block indexing instead, because syndicated pages often differ too much for a canonical to hold.

OK

Olga Kunger

Founder & Lead Strategist, Ambeltek

Olga leads Ambeltek's web development, AI SEO, and GEO work — helping brands rank on Google and get cited by AI engines. More about Olga →

Want structured data that engines trust?

We audit, design and ship connected JSON-LD for your whole site, validated and monitored.