deadhead
head/canonical-multiple

more than one rel=canonical

A page that declares more than one canonical URL has Google ignore all of them, so its duplicate URLs stop consolidating.

  • Avoid
  • Harmful
Severity
HarmfulActively breaks something for users.
Basis
Vendor documentationOne vendor's documentation is the source.
Detectable
YesMatched exactly. Autofixable when the rule carries a fix.
Matches
logic moduleDocument rule, anywhere in the document.
Fix
None — reports only
Impacts
SEO
Related
link/sitemap

<link rel="canonical"> names the one URL that should represent a page when the same content is reachable at several: with and without tracking parameters, with and without a trailing slash, over http and https. It only works as a single answer. Two of them on one page don’t split the difference. They cancel each other out.

Why avoid

Google throws them all away. Its Search Central guidance is explicit: “Specify no more than one rel=canonical for a page. When more than one is specified, all rel=canonical links will be ignored.” The page loses the one signal meant to tell Google which of its duplicate URLs should rank. Google chooses a canonical on its own, and links pointing at the different variants stop consolidating onto one URL.

The relation’s own definition asks for one. RFC 6596, which registers canonical, advises: “Specify only one canonical link relation for a resource. (It would be confusing to consider/label/designate more than one IRI as authoritative.)”

It almost never happens on purpose. A theme emits a canonical and an SEO plugin adds another. A CMS writes one and the layout writes one. A client-side router appends a fresh canonical on navigation without removing the server-rendered one. The two often point at different URLs, nothing on the page looks wrong, and the first sign is a Search Console report weeks later.

Use instead

One canonical, with an absolute URL, in <head>:

<link rel="canonical" href="https://example.com/dresses/green-dress">

<link rel="alternate"> is for alternative versions of a page, not a second canonical. Use hreflang for other languages and regions, and media for a separate mobile site:

<link rel="alternate" hreflang="de" href="https://example.com/de/kleider/gruenes-kleid">
<link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.example.com/dresses/green-dress">

Google gives the same advice: use “the appropriate link annotations to specify alternate versions of a page”, with rel="alternate" and hreflang for language and country.

Detectability

Fully detectable, as a document rule, because a selector can’t count. Once a page has two or more link[rel~="canonical"], every one of them is reported. Google ignores all of them, and which to keep is the author’s decision. Identical duplicates count, since the problem is the number of declarations. A canonical in <body> counts too: Google wouldn’t accept it on its own, but it is still a second declaration.

There is no autofix: removing either one means choosing the canonical URL.

Resources

This page is generated from content/rules/head/canonical-multiple.md, the same file the linter is built from. Think the rule is wrong, or that browsers moved on? Say so — that is the most useful issue you can file.