CanonicalTag.com logoCanonicalTag.comThe canonical tag & URL canonicalization
Canonical guide

What Is a Canonical Tag?

The line of HTML that tells search engines which version of a page is the real one.

What a canonical tag is

A canonical tag is a piece of HTML markup, written as <link rel="canonical" href="...">, that you place in the <head> of a web page to tell search engines which URL you consider the preferred, authoritative version of that page's content. The term comes from computer science, where "canonical" describes the standard, simplified form of something when multiple equivalent forms exist. On the web, the same piece of content is routinely reachable through more than one URL — with a tracking parameter appended, with or without a trailing slash, over HTTP or HTTPS, on a print-friendly page versus the standard one. The canonical tag is how you point at the one you want treated as the real version.

The specification behind it, RFC 6596, was introduced jointly by Google, Bing, and Yahoo in 2009, which is why rel=canonical works across search engines, not just Google. That shared adoption is part of why it became the standard mechanism for handling duplicate content, rather than something each search engine solved separately.

What the canonical tag does

The core job of a canonical tag is consolidation. When several URLs serve the same or substantially similar content, they compete with each other for ranking signals — links pointing at different variants, social shares split across versions, and search engines potentially indexing more than one copy. The canonical tag tells search engines to treat those URLs as one cluster and fold their signals into a single preferred URL.

Consolidation matters because duplicate content, left unmanaged, does not typically get a page "penalized." What actually happens is more mundane and more costly: your ranking signals get diluted across multiple URLs instead of concentrating on one, and search engines have to decide on their own which version to show — a decision you'd rather make yourself. A well-placed canonical tag on a parameterized URL like /shoes?color=blue&sort=price tells Google "this is the same page as /shoes, count it as one," rather than leaving Google to sort out the relationship on its own.

The anatomy of a rel=canonical tag

In its most common form, the canonical tag looks like this:

<head>
  <link rel="canonical" href="https://www.example.com/page.html" />
</head>

A few structural rules govern how this tag has to be written and placed for search engines to honor it:

  • It must appear inside the <head> of the HTML document. A rel=canonical tag placed in the <body> is ignored.
  • The href value should be an absolute URL — the full https://www.example.com/page.html form — rather than a relative path like /page.html. Google explicitly recommends absolute paths, warning that relative paths "can cause problems in the long run," such as when a staging or testing domain gets crawled and the relative canonical resolves against the wrong host.
  • Only one rel=canonical tag should exist per page. Multiple canonical tags pointing to different URLs create a conflict search engines are likely to simply ignore, falling back to their own judgment.
  • Attributes like hreflang, media, or type placed on the canonical link element itself are ignored by Google — they carry no weight there.
  • The tag should not point to a URL fragment (an anchor like #section).

For non-HTML files such as PDFs, where there's no <head> to put a link tag in, the same signal can be sent via an HTTP response header instead: Link: <https://www.example.com/downloads/file.pdf>; rel="canonical". Google has supported this HTTP-header variant since 2011.

How Google uses the canonical tag: a hint, not a directive

This is the single most important thing to understand about the canonical tag, and it's easy to miss: rel=canonical is a signal, not a command. Google's own documentation is direct about it — none of the canonicalization signals, rel=canonical included, are required, and a site "will likely do just fine without specifying a canonical preference" at all. Google describes rel=canonical as "a strong signal that the specified URL should become canonical," which is stronger language than it uses for some other signals, but strong is not the same as absolute.

In practice, Google weighs your declared canonical against other evidence: whether the target actually returns a normal 200 status, whether it's indexable, whether it has more internal and external links pointing at it, whether it's served over HTTPS, and whether it's included in your sitemap (a comparatively weak signal on its own). When those signals disagree with your declared canonical — say, you point rel=canonical at a page that itself redirects, or that has far fewer internal links than the "duplicate" — Google can and does override your declaration and select a different URL as canonical. You can see this play out directly in Google Search Console's URL Inspection tool, which reports both the "user-declared canonical" and the "Google-selected canonical" for a given URL, and the two do not always match.

This is also why canonical tags should never be treated as a way to hide or de-index a page. If you need a page kept out of search results entirely, that's a job for noindex, not rel=canonical — mixing the two on the same page creates a contradiction, since one says "consolidate here" and the other says "drop this from the index entirely."

When you need a canonical tag

Not every page needs an explicit canonical tag, but a number of common situations call for one:

  • URL parameters. Tracking parameters (?utm_source=), session IDs, and faceted-navigation parameters (?color=red&sort=price) routinely generate many URLs for what is functionally one page. A canonical tag on each parameterized version, pointing back to the clean URL, keeps them from being indexed as separate duplicates.
  • Content variants. Print-friendly versions, AMP pages, and mobile ("m.") subdomains often serve near-identical content under a different URL. Canonicalizing the variant to the primary version is standard practice.
  • Syndicated content. When an article is republished on another domain, a cross-domain canonical can point the copy back to the original. It's worth knowing this comes with caveats — Google's guidance on cross-domain canonicals for syndication has shifted, and it's covered in more depth in the cross-domain canonical guide.
  • Self-reference. Even a page with no duplicates is commonly given a canonical tag pointing to itself. This isn't required, but it removes any ambiguity about which exact URL form — protocol, host, trailing slash — is the preferred one, especially since the same page is often reachable through small variations of its own URL.

How the canonical tag differs from other tags

The canonical tag is frequently confused with a handful of other mechanisms that sound similar but do different jobs:

  • 301 redirect. A 301 redirect is server-side and near-authoritative: it sends both users and search engines from URL A to URL B, and URL A becomes inaccessible. Google treats a 301 as a strong signal that the redirect target should be canonical. A canonical tag, by contrast, is an in-page hint — both URLs stay live and accessible to users, and only indexing behavior is affected. Use a redirect when a URL should permanently disappear (a domain migration, an HTTP-to-HTTPS move); use a canonical tag when both URLs need to keep working for visitors but only one should be indexed.
  • Noindex. Noindex tells search engines not to index a page at all. Canonical tells them to index a different page instead of this one, while still crawling and understanding this one as part of the cluster. Using both on the same page is contradictory, and noindex tends to take priority, which can prevent the consolidation the canonical tag was meant to achieve.
  • Hreflang. Hreflang tells search engines that several URLs are equivalent content aimed at different languages or regions, and that each one should be indexed and served to the matching audience. Canonical tells search engines that several URLs are duplicates and only one should be indexed. Pointing a translated page's canonical at a different-language version of the page contradicts hreflang's whole purpose — each URL in an hreflang cluster should self-canonicalize.

How to check a page's canonical tag

Checking a canonical tag doesn't require special tools. The most direct method is to view the page's raw HTML source and search for rel="canonical" within the <head> section — this shows you exactly what's declared, including whether there's more than one (a conflict worth fixing) or whether it's missing entirely.

For a view of how Google itself is treating the page, Google Search Console's URL Inspection tool is the authoritative source. It reports the user-declared canonical alongside the Google-selected canonical, so you can see directly whether Google agrees with what you specified or has chosen something else. Site crawling tools such as Screaming Frog can also surface canonical tags across an entire site at once, flagging pages with missing, self-referencing, or multiple canonicals in bulk — useful for catching template-level issues that a single-page check would miss.

Frequently Asked Questions

Is a canonical tag the same as a redirect?

No. A 301 redirect is a server-side instruction that sends both users and search engines from one URL to another, and the original URL stops working. A canonical tag is an in-page hint that only affects indexing — both URLs remain live and accessible to visitors. Use a redirect when a URL should permanently go away; use a canonical tag when both URLs need to stay accessible but only one should be indexed.

Does every page need a canonical tag?

No. Google's own documentation says a site will likely do just fine without specifying a canonical preference at all, since Google can identify the best version on its own when nothing is declared. That said, adding a self-referencing canonical to every page is a common, low-risk best practice that removes ambiguity about which exact URL form is preferred.

Can I have more than one canonical tag on a page?

You shouldn't. A page should carry exactly one rel=canonical tag. When a page has multiple canonical tags pointing to different URLs — often caused by a theme and an SEO plugin both injecting one — the behavior is undefined, and Google is widely understood to ignore all of them and fall back to its own selection, meaning you lose control over the outcome entirely.

Will Google always follow my canonical tag?

Not always. Google describes rel=canonical as a strong signal, but explicitly not a directive it's required to follow. Google weighs your declaration against other signals — redirects, HTTPS, internal links, sitemap inclusion, content quality — and can select a different URL as canonical if those signals point elsewhere. You can check whether Google agreed with your declaration using the URL Inspection tool in Search Console.

Should the canonical tag use an absolute or relative URL?

Absolute. Google explicitly recommends using absolute URLs (the full https://www.example.com/page form) rather than relative paths, because relative paths can cause problems if a different environment, such as a staging site, ends up getting crawled — the relative canonical would resolve against the wrong host.