← All posts
Guide

What is a canonical tag, and when do you actually need one?

What rel="canonical" does, how often sites actually use it, the three places it can live, and the HTTP Archive data on how it breaks.

Findability · Canonical tags · Technical SEO
The short answer

A canonical tag tells search engines which URL is the preferred version when the same content lives at more than one address, such as with tracking parameters or HTTP/HTTPS variants. Google treats it as a hint it can override, picking a different canonical than specified. In 2024, 69% of desktop pages and 65% of mobile pages carried one, and conflicting signals are the most common way they break.

Key takeaways
  • Canonical tag adoption rose from 59% of desktop pages in 2022 to 69% in 2024, and from 61% to 65% of mobile pages, per the HTTP Archive Web Almanac.
  • The HTTP header is the rarest place to set a canonical, used on about 1% of pages, far behind the 65% that carry a `<head>` tag surviving JavaScript rendering.
  • Canonical mismatches between the HTTP header and the rendered page affected 0.8% of pages in 2024, double the 0.4% recorded in 2022.
  • JavaScript rendering changes the canonical value found in a page's raw HTML on 2.1% of mobile pages and 1.9% of desktop pages.
  • Of pages with a canonical element present, 98% passed Google Lighthouse's check for a valid rel="canonical" tag.
  • Google can override a declared canonical tag and choose a different canonical URL than the one a site specifies.
Contents
  1. What does a canonical tag actually do?
  2. How many sites actually use a canonical tag?
  3. Where should the canonical tag actually live?
  4. What actually breaks a canonical tag?
  5. How do you fix a conflicting or missing canonical tag?
  6. Where does this fit in a site's findability checks?
  7. Sources

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.

Fig. 1A duplicate URL points at its canonical; the canonical points at itselfA self-referencing canonical on the preferred page, a cross-referencing one on the duplicate.
<head> on /dresses/cocktail?gclid=ABCD
<link rel="canonical"
      href="https://example.com/dresses/green/green-dress.html" />
<head> on /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.

Fig. 2Canonical tag adoption, 2022 vs. 2024Share of pages using a canonical tag, by device, across the two most recent Web Almanac 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.

Table 1Canonical tag implementation methods, 2024Share of pages using each method, from the HTTP Archive's 2024 crawl.
Method2024 usageWorks onCaveat
HTTP header (Link header)~1% of pagesAny file type, including PDFsNeeds server configuration; the rarest method by far
rel="canonical" tag in the page's <head>~65% of pages, as renderedHTML pages onlyThe standard method; must survive JavaScript rendering unchanged
Listed in an XML sitemapNot measured separately by the AlmanacHTML pages included in the sitemapEasier 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.

Fig. 3Where canonical signals disagree with themselvesRates of inconsistency across the HTTP header, raw HTML and rendered DOM, 2024 crawl.
  • 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.

Table 2Google's canonicalization best practices
DoDon't
Include a self-referencing canonical on the canonical page itselfUse robots.txt to manage canonicalization
Set the canonical URL in the HTML source whenever possibleLet JavaScript change a canonical already declared in the HTML
Keep the sitemap, HTTP header and head tag pointing at the same URLDeclare a different canonical URL in each of the three places
Link internally to the canonical URL, not the duplicateUse the URL removal tool to manage duplicate content
Pair a canonical with a matching-language hreflang setUse 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.

  1. 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.
  2. Confirm every page that should rank for itself carries a self-referencing canonical, rather than one pointing at a category or filtered URL.
  3. Run dxbub's free website audit to read canonicals across up to 60 pages as part of the Search & Findability pillar.

Sources

  1. HTTP Archive: 2024 Web Almanac, SEO chapter
  2. Google Search Central: Canonicalization
  3. Google Search Central: Consolidate duplicate URLs

See it on your own site

dxbub turns a single URL into a scored, sourced, ordered plan across all six pillars, AI Visibility included.

Free AI visibility check. No sign-up required.

Related reading