Question

Canonical Tags: Solving Duplicate Content Issues

11 min read

Short answer

A canonical tag tells Google which URL you prefer when several URLs show the same or nearly the same content. It is a hint, not an instruction: Google's documentation says "indicating a canonical preference is a hint, not a rule", and Google can pick a different URL. Canonicals work best when every other signal agrees with them: redirects, sitemaps and internal links pointing to the same URL, and duplicates that really are duplicates. Duplicate content on its own is not a penalty; Google says "Some duplicate content on a site is normal and it's not a violation of Google's spam policies."

Sources

  1. 1developers.google.com
  2. 2developers.google.com
  3. 3rfc-editor.org
  4. 4developers.google.com
  5. 5developers.google.com
  6. 6support.google.com

Ask next

What Canonicalization Means in Google’s Terms

Google’s canonicalization overview defines it as “the process of selecting the representative – canonical – URL of a piece of content.” When Google finds pages whose primary content looks the same or very similar, it “clusters them together” and marks one as canonical. That page “will be crawled most regularly; duplicates are crawled less frequently”, and it is “the main source to evaluate content and quality.”

Google lists the usual sources of duplicates: region variants in the same language, device variants such as separate mobile pages, HTTP and HTTPS versions, sorting and filtering functions, and accidental variants such as a demo site left open to crawlers.

Translated pages are a different case. Google treats language versions as duplicates “only if the primary content is in the same language”, for example when only the header and footer are translated.

The Signals and How Strong Google Says They Are

Google’s guide to consolidating duplicate URLs ranks the methods you control “in order of how strongly they can influence canonicalization”:

Method Google's description of its strength Use it when
Redirect "A strong signal that the target of the redirect should become canonical" The duplicate URL has no reason to stay reachable
rel="canonical" element or HTTP header "A strong signal that the specified URL should become canonical" Both URLs need to stay reachable
Sitemap inclusion "A weak signal" As support for the other two, listing canonical URLs only

Google adds that the methods “can stack and thus become more effective when combined”, and that “none of them are required”: without a declared preference, Google picks the version it considers best. Beyond these, Google uses signals from site setup, including a preference for HTTPS over HTTP unless the HTTPS page has problems such as an invalid certificate or a canonical pointing to the HTTP version.

Internal links count as well. The same guide says: “When linking within your site, link to the canonical URL rather than a duplicate URL.” A canonical tag that points one way while the navigation links the other way is asking Google to resolve a contradiction.

Why Specifying a Canonical Is Worth It

Google gives four reasons to declare a preference: to choose the URL people see in results, to “consolidate signals for similar or duplicate pages”, to simplify tracking metrics for one piece of content, and to avoid spending crawl time on duplicates. On the second point Google is specific: canonicalization lets search engines “consolidate the signals they have for the individual URLs (such as links to them) into a single, preferred URL.”

The situations where that pays off:

  • Parameters. Tracking parameters such as gclid or utm_source, sort orders and filters can each create a URL for the same content. Point their canonicals at the clean URL, and link internally to the clean URL only.
  • Protocol and host variants. HTTP and HTTPS, www and non-www, trailing slash or not. Redirects are the better tool here, with the canonical as support.
  • Separate mobile URLs. Google’s guide shows the desktop page carrying a rel="alternate" link with a media attribute pointing to the mobile URL, alongside its canonical.
  • File formats. A PDF and a Word version of the same document can name one as canonical through the HTTP header.

Canonical or Redirect

The question is whether anyone still needs the duplicate URL. Google’s guide says to use redirects “when you want to get rid of existing duplicate pages”, and to prefer server-side redirects for “the quickest effect”. If the URL has no purpose, such as an old path, a retired variant or an HTTP version, redirect it; the status codes are covered in HTTP status codes for SEO.

Keep the canonical when the duplicate must stay reachable: a sorted listing a shopper uses, a print version, a campaign URL with tracking parameters. A setup can use both, for example a redirect from /page to /page/ plus a self-referencing canonical on /page/. Those signals agree, which is what Google’s stacking advice describes.

Writing the Element and the Header

The element goes in the <head> of every duplicate and of the canonical page itself:

<head>
  <title>Green dresses</title>
  <link rel="canonical" href="https://www.example.com/dresses/green/" />
</head>

Rules from Google’s guide that affect how you write it:

  • Absolute URLs. Google says “Use absolute paths rather than relative paths with the rel=”canonical” link element”, because relative paths, while supported, “can cause problems in the long run”, for example when a test site is crawled. The standard itself, RFC 6596, allows a relative target; Google’s recommendation is the stricter one, and it is the one to follow.
  • Head only. The element “is only accepted if it appears in the <head> section of the HTML,” so the <head> must be valid HTML up to that point.
  • One method per page. Google supports the element and the HTTP header but recommends choosing one, because using both “is more error prone”.
  • No fragments. Don’t name a # URL as canonical; Google “generally doesn’t support URL fragments.”
  • No alternate attributes. A rel=”canonical” carrying hreflang, lang, media or type is ignored for canonicalization; alternates use rel="alternate".
  • JavaScript. The clearest setup is a canonical in the HTML source that JavaScript doesn’t change. If the source can’t carry it, Google says to leave it out of the source and set it only with JavaScript, so the two never disagree.

For non-HTML files, send the header instead:

Link: <https://www.example.com/downloads/white-paper.pdf>; rel="canonical"

Google says it supports the header “for web search results only”, and that it should also use absolute URLs.

On WordPress, Shopify and similar platforms the canonical comes from the theme or an SEO plugin. Check the page source of a few page types to confirm there is exactly one canonical and that it points where you expect.

Self-Referencing Canonicals

Google’s best practices say: “Do include a rel=”canonical” link on the canonical page itself (also known as a self-referential canonical).” The practical benefit is that parameter versions you didn’t create, such as ad click IDs or links shared with tracking tags, arrive at a page that already names its clean URL.

The tag has to be generated per page. A template that prints one fixed URL, such as the homepage, on every page tells Google that every page is a duplicate of that URL. Google’s troubleshooting guide notes that “Some content management systems (CMS) or CMS plugins can make incorrect use of canonicalization techniques to point to undesired URLs.” Check a sample of templates after every theme or plugin change.

Syndication and Cross-Domain Canonicals

Cross-domain canonicals are supported, but Google doesn’t recommend them for syndication. Its canonicalization troubleshooting guide says: “The canonical link element is not recommended for those who want to avoid duplication by syndication partners, because the pages are often very different. The most effective solution is for partners to block indexing of your content.”

So if a partner republishes your article and you want your version to rank, ask the partner to keep their copy out of the index with noindex. A canonical from the partner’s page to yours is a hint Google may not follow when the two pages differ in layout, surrounding content and comments. A link from the partner’s copy back to your original also helps readers find the source.

Two other cross-domain situations from the same guide are worth knowing. A hacked site can have a cross-domain canonical injected into its <head> or HTTP header, pointing to a spam URL, and Google may then pick that URL. A copycat site can occasionally be chosen as canonical for your content; the guide points to copyright channels for that case. If an unexpected external URL shows up as Google’s choice for your page, check for injected code first.

Mistakes That Make Google Choose Differently

  1. Canonicalizing pages that aren’t duplicates. The Page indexing report’s help says: “If the user-declared canonical is not similar to the current page, then Google won’t ever choose that URL as canonical. A duplicate page must be similar to the canonical.” Two different articles don’t become one through a tag; merge them and redirect, a choice covered in keyword cannibalization.
  2. Contradicting yourself across methods. Google says not to specify “one URL in a sitemap, but a different URL for that same page using rel=”canonical”.” The sitemap should list canonical URLs only, as described in XML sitemaps.
  3. Using robots.txt or noindex to pick a canonical. Google advises against both. Robots.txt doesn’t keep a URL out of the index: “Google may still index URLs that are disallowed in robots.txt without their content.” On noindex: “We don’t recommend using noindex to prevent selection of a canonical page within a single site, because it will completely block the page from Search.” The URL removal tool is also not a canonicalization method; it “hides all versions of a URL from Search.”
  4. Pointing at a URL that redirects or fails. Point every canonical directly at the final, crawlable, indexable URL. A canonical aimed at a URL that redirects, returns an error or declares a different canonical leaves Google with two hints instead of one. Chains created by redirects are covered in redirect chains and loops.
  5. Canonicalizing pagination to page one. Google’s pagination guidance says: “Don’t use the first page of a paginated sequence as the canonical page. Instead, give each page its own canonical URL.” Details are in pagination and infinite scroll.
  6. Mismatching canonical and hreflang. With hreflang, Google says to specify “a canonical page in the same language, or the best possible substitute language if a canonical page doesn’t exist for the same language.” A French page that canonicalizes to the English page asks Google to treat it as a duplicate of the English one; see hreflang implementation.

Reading Google’s Choice in Search Console

URL Inspection shows two fields for an indexed URL: the user-declared canonical and the Google-selected canonical. When they differ, Google’s troubleshooting guide asks you to “think about whether the Google-selected canonical makes more sense than your preferred canonical URL for your users coming from Google Search.” The live test doesn’t help here; the Page indexing report’s help notes that “duplicate or canonical conditions are not tested in the live test.”

The Page indexing report uses three statuses that relate to canonicals:

Status What Google says it means What to do
Alternate page with proper canonical tag The page "correctly points to the canonical page, which is indexed, so there is nothing you need to do" Nothing, if the alternate is expected
Duplicate without user-selected canonical The page is a duplicate, declares no preference, and Google "has chosen the other page as the canonical" Declare a canonical if Google's choice is wrong; make the content differ substantially if the page isn't a duplicate
Duplicate, Google chose different canonical than user The page is "marked as canonical for a set of pages, but Google thinks another URL makes a better canonical" Compare the page, your declared canonical and Google's choice in a browser, then align the signals or accept Google's choice

The same help page says that having pages marked duplicate or alternate “is usually a good thing; it means that we’ve found the canonical page and indexed it.” Focus on statuses that affect important pages.

When you fix a cluster that shouldn’t be grouped, give it time. The troubleshooting guide says Google “might hold pages in a duplicate cluster for up to two weeks” after the content changes, that pages split out faster when the difference is “clear and significant”, and that indexing requests through URL Inspection are subject to quotas, so they’re best kept for the most important URLs.

Canonicals on Different Kinds of Sites

  • Online stores. Sort and filter URLs are the main source of duplicates. Canonicalize parameter versions to the clean listing, and decide which filter combinations deserve their own indexable page; that decision is covered in faceted navigation SEO. Product variants that differ only by color or size can share one canonical; variants with their own content and searches can stand alone.
  • Publishers. Print views, tracking-tagged URLs from newsletters and social shares, and syndicated copies. Canonicalize the first two to the article; handle syndication with the partner’s noindex.
  • Service businesses. The same service page reachable through several paths, such as a services folder and a location folder. If the pages carry the same text, pick one URL, redirect the others where possible, and link to that one URL. A location page with its own useful content is not a duplicate and shouldn’t canonicalize away.
  • International sites. For the same language in different regions, Google says to “use both canonicalization and hreflang” so it can show the right regional URL.
  • JavaScript applications. Make sure the canonical is in the server-rendered HTML or set only once by JavaScript; rendering issues are covered in JavaScript SEO.

When Google’s selected canonical differs from yours, check that the redirects, the canonical element, the sitemap and the internal links for that page all name the same URL before changing anything else.

Link profile

Cites 6 sources

  1. canonicalization overview developers.google.com
  2. consolidating duplicate URLs developers.google.com
  3. RFC 6596 rfc-editor.org
  4. canonicalization troubleshooting guide developers.google.com
  5. pagination guidance developers.google.com
  6. Page indexing report support.google.com