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
- Is the canonical tag a directive or a hint?
- When should you use a canonical tag?
- Canonical vs noindex vs redirect vs robots.txt
- Cross-domain canonicals and syndication
- Common canonical tag mistakes
- How do you check which canonical Google chose?
- Getting canonicalization right on your site
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.
Scroll the diagram sideways to see all of it.
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://andhttps://,wwwand 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.
| Tool | What it tells Google | Visitors still reach the URL? | Consolidates signals? | Use it for |
|---|---|---|---|---|
| 301 or 308 redirect | The content moved for good | No, they are forwarded | Yes, strongest signal | Retired URLs, host and protocol variants |
rel="canonical" | Index the other URL instead | Yes | Yes, strong signal | Sort orders, parameters, near-identical variants |
noindex | Don’t index this page at all | Yes | No | Thank-you pages, internal search results |
robots.txt Disallow | Don’t crawl this path | Yes | No | Infinite 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.
Scroll the diagram sideways to see all of it.
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:
- 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.
- 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. - Every page canonicalized to the homepage. A template default that tells Google the entire site is a copy of one page.
- Paginated series canonicalized to page one. Page 2 of a category lists different products from page 1, so it is not a duplicate.
- Canonical and
noindexon the same page. One says “index the other URL”, the other says “index nothing”. Pick one. - Conflicting signals. The tag says one URL while the sitemap, internal links and hreflang all use another. Google may overrule the tag.
- 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.
- More than one canonical tag. Plugins and themes that each inject their own tag leave Google with two answers.
- A URL fragment as the canonical. Google’s guide lists
#sectioncanonicals 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.
Scroll the diagram sideways to see all of it.
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.