What does a canonical tag actually do?
A canonical tag marks which URL is the preferred, representative version when the same content sits at more than one address. Google weighs it as one signal among several, alongside HTTP/HTTPS status, redirects and a URL's presence in the sitemap, before choosing.
<link rel="canonical"
href="https://example.com/dresses/green/green-dress.html" /><link rel="canonical"
href="https://example.com/dresses/green/green-dress.html" />The tracked, duplicate URL points its canonical at the clean one. The clean URL points at itself: a self-referencing canonical, the setup Google Search Central recommends for the page it is on.
- Tracking parameters. The same page reached through a campaign link with a query string attached.
- Protocol or host variants. HTTP versus HTTPS, or www versus the bare domain.
- Device variants. A separate mobile URL serving the same content as the desktop page.
- Site functions. Sorting and filtering on a category page that generate new URLs for the same product list.
How many sites actually use a canonical tag?
Most do, and adoption kept climbing between the HTTP Archive's 2022 and 2024 crawls.
- Desktop pages, 202259%
- Desktop pages, 202469%
- Mobile pages, 202261%
- Mobile pages, 202465%
Source: HTTP Archive Web Almanac 2024, SEO chapter.
Where should the canonical tag actually live?
A canonical can be declared in three places, and they are not used equally.
| Method | 2024 usage | Works on | Caveat |
|---|---|---|---|
| HTTP header (Link header) | ~1% of pages | Any file type, including PDFs | Needs server configuration; the rarest method by far |
| rel="canonical" tag in the page's <head> | ~65% of pages, as rendered | HTML pages only | The standard method; must survive JavaScript rendering unchanged |
| Listed in an XML sitemap | Not measured separately by the Almanac | HTML pages included in the sitemap | Easier to maintain at scale, but a weaker signal than an on-page tag |
Source: HTTP Archive Web Almanac 2024, SEO chapter; Google Search Central: Consolidate duplicate URLs.
What actually breaks a canonical tag?
A canonical can be declared more than once, in the header, the raw HTML and the rendered DOM, and the three do not always agree.
- HTTP-header canonical disagrees with the rendered head tag0.8%
- Rendering changes an HTTP-header canonical (desktop)0.6%
- Rendering changes the raw-HTML canonical (desktop)1.9%
- Rendering changes the raw-HTML canonical (mobile)2.1%
Source: HTTP Archive Web Almanac 2024, SEO chapter.
How do you fix a conflicting or missing canonical tag?
Google Search Central's guidance on consolidating duplicate URLs comes down to keeping one signal, declared once, and leaving it alone.
| Do | Don't |
|---|---|
| Include a self-referencing canonical on the canonical page itself | Use robots.txt to manage canonicalization |
| Set the canonical URL in the HTML source whenever possible | Let JavaScript change a canonical already declared in the HTML |
| Keep the sitemap, HTTP header and head tag pointing at the same URL | Declare a different canonical URL in each of the three places |
| Link internally to the canonical URL, not the duplicate | Use the URL removal tool to manage duplicate content |
| Pair a canonical with a matching-language hreflang set | Use noindex to pick a canonical among single-site duplicates |
Source: Google Search Central: Consolidate duplicate URLs.
Does a canonical tag guarantee which URL Google shows in search results?
No. Google Search Central describes rel="canonical" as a hint that search engines can override. Google also weighs whether a page is served over HTTP or HTTPS, redirects, and whether the URL appears in a sitemap, and can still choose a different canonical than the one specified.
Should a canonical tag ever be set only with JavaScript?
Only when there is no other option. Google Search Central recommends setting the canonical URL in the HTML source and making sure JavaScript does not change it; if the HTML source cannot carry it, leave it out of the source entirely and set it only with JavaScript, rather than letting a script override a canonical already in the HTML.
Where does this fit in a site's findability checks?
dxbub's crawl reads the canonical tag on every page as part of the Search & Findability pillar, alongside status codes, titles and structured data, and flags one that points at the wrong URL or disagrees with what the page's own markup declares.
- Open a page's actual rendered HTML alongside its raw server response, and confirm the canonical in the <head> matches any value set in an HTTP header or sitemap entry.
- Confirm every page that should rank for itself carries a self-referencing canonical, rather than one pointing at a category or filtered URL.
- Run dxbub's free website audit to read canonicals across up to 60 pages as part of the Search & Findability pillar.