Skip to content
Technical SEO

Canonical Tags and Duplicate Content Explained

11 min readPublished By Sanju Joseph

Most websites publish the same content at more than one URL without meaning to. A product reachable from three category paths, a page that loads with and without a trailing slash, a blog post with tracking parameters stuck to it, an http:// copy that never got redirected: to a search engine, each of these is a separate URL that might be a separate page. Canonicalization is the process of telling search engines which of those URLs is the main one, so that ranking signals are consolidated in one place and the right URL appears in search results.

The rel="canonical" tag is the best-known tool for this, but it is only one of several signals, and it is a hint rather than a command. This guide explains how Google actually chooses a canonical URL, how to write the tag correctly, how to handle the common duplicate scenarios (www and https, parameters, pagination, product variants, syndication, international sites), when a redirect or noindex is the better choice, and how to diagnose the frustrating case where Google ignores your choice.

Where Duplicate URLs Come From

"Duplicate content" in SEO rarely means copied articles. It almost always means one page with many addresses. The usual sources:

  • Protocol and host variants: http:// and https://, www. and non-www.
  • Trailing slashes and case: /pricing and /pricing/ are different URLs to a search engine, and so are /Pricing and /pricing on most servers.
  • Index files: /blog/ and /blog/index.html.
  • Parameters: tracking (?utm_source=), sorting (?sort=price), filtering, session IDs, and print views.
  • Multiple paths to one item: e-commerce products under several categories, blog posts under several tags.
  • Variants: one product page in several colours or sizes, each with its own URL.
  • Syndication and scraping: your article republished on partner sites.
  • Staging and preview hosts that were accidentally left open to crawlers.

None of this triggers a "duplicate content penalty"; Google has said for many years that duplication within a site is normal and is not penalised unless it is deceptive. The real costs are practical: crawlers waste time on copies, links and other signals get split across several URLs, and Google may show a URL you would not have chosen (a parameter-laden one, or the http version) in search results.

How Google Chooses a Canonical

When Google finds a group of duplicate or near-duplicate pages, it picks one as canonical and treats the rest as alternates. It weighs several signals, and Google's documentation describes some as strong and others as weak:

SignalStrengthNotes
301 / 308 redirectsStrongThe redirected URL stops being a candidate
rel="canonical" linkStrongA hint, but usually followed when other signals agree
Inclusion in the XML sitemapWeakListing a URL suggests it is the preferred version
Internal and external linksSupportingThe URL you link to consistently is the one you appear to prefer
HTTPS over HTTPSupportingGoogle generally prefers the HTTPS version when both exist
hreflang annotationsSupportingHelp Google keep language versions separate rather than folding them together

The practical lesson: canonicalization works best when every signal points the same way. If your canonical tag says /pricing, your sitemap lists /pricing/, and your navigation links to /pricing?ref=nav, you have three votes for three different URLs and Google will pick whichever it finds most convincing.

Writing the Canonical Tag

The tag goes in the <head> of the duplicate page and points to the preferred URL:

<!-- On https://www.example.com/shoes/trail-runner?color=blue&utm_source=newsletter -->
<head>
  <link rel="canonical" href="https://www.example.com/shoes/trail-runner" />
</head>

For files that have no HTML head, such as PDFs, send the same signal as an HTTP response header:

HTTP/1.1 200 OK
Content-Type: application/pdf
Link: <https://www.example.com/guides/sizing-chart.pdf>; rel="canonical"

Rules for a canonical Google will trust

  • Put it in the head. Google ignores rel="canonical" found in the body. A common accident is an unclosed tag or a script that makes the browser end the head early, pushing the canonical into the body.
  • Use absolute URLs. Relative URLs are supported, but absolute ones (with protocol and host) avoid mistakes such as a staging host canonicalising to itself.
  • Declare it once. Two canonical tags with different targets (often one from the theme and one from a plugin) may cause Google to ignore both.
  • Point to a working, indexable page. The target should return 200, not redirect, not 404, and not carry noindex.
  • Keep the content equivalent. A canonical tells Google two pages are the same. Pointing a page about red shoes at a page about blue boots is likely to be ignored.
  • Put it in the initial HTML. Google can read a canonical added by JavaScript, but it recommends against changing it with JavaScript, and a script that rewrites the canonical to something different from the server-rendered one sends conflicting signals.

Check any URL's canonical, both in the HTML and in HTTP headers, with the canonical checker. It tells you whether the canonical is self-referencing, points elsewhere, is missing, or conflicts with other signals.

Self-Referencing Canonicals

A self-referencing canonical is a canonical tag on a page that points to that same page's clean URL. Google does not require it, but it is a widely recommended default, because it quietly handles the duplicates you did not plan for. When someone links to your post with ?utm_campaign=spring or ?fbclid=... attached, the self-referencing canonical on the page still names the clean URL, and the parameter version consolidates into it.

The key is that the self-reference must be the clean URL. A template that outputs the current request URL, parameters included, as the canonical defeats the purpose: every parameter variant then claims to be canonical. If you build canonicals in code, construct them from the page's known path, not from whatever URL the visitor happened to request.

Scenario by Scenario

www, non-www, http, and https

These are site-wide duplicates, and the right fix is a 301 redirect, not a canonical tag. Choose one version (today that should be HTTPS, with or without www as you prefer), redirect every other combination to it in one hop, and then add matching self-referencing canonicals as a backup. The canonicalization audit checks that all four protocol and host variants end up at the same URL, and the redirect chain checker confirms they get there without extra hops. The redirects guide has the server rules.

Trailing slashes

Pick one convention and redirect the other. Most frameworks and CMSs have a setting for this. Then make sure your internal links, sitemap, and canonical tags all use the chosen form. Mixing them is one of the most common reasons Google picks a different canonical than the one you declared. The URL SEO checker flags inconsistent formatting such as uppercase letters and trailing slash habits.

Tracking, sort, and session parameters

Parameters that do not change the main content (tracking codes, sort order, session IDs, view modes) should canonicalise to the clean URL. Google retired the URL Parameters tool in Search Console in 2022, so canonical tags, consistent internal links, and clean sitemaps are now the main ways to tell it which parameters do not matter. If a parameter generates endless crawlable combinations (faceted filters on a large store), you may also want to limit crawling of those patterns with robots.txt, but understand the trade-off: a blocked URL cannot be crawled, so Google cannot see its canonical tag either.

Faceted filters that deserve to rank

Not every parameter page is a duplicate. A filter for "waterproof" on a jackets category may be a page people genuinely search for. If you want it to rank, give it a clean URL, unique title and introduction, a self-referencing canonical, and internal links. Pick those deliberately from keyword research, and canonicalise the rest to their parent category.

Pagination

Page 2 of a category lists different products than page 1, so it is not a duplicate. Each page in a paginated series should have a self-referencing canonical, not a canonical to page 1. Canonicalising every page to page 1 tells Google the items on later pages are not worth finding. Google stopped using rel="next" and rel="prev" as indexing signals in 2019, so what matters is that pages link to each other with normal crawlable links. Check a series with the pagination checker. A "view all" page is a reasonable canonical target only if it loads fast and actually contains everything.

Product variants

If colour or size variants share the same description and only differ by a selector, canonicalise variant URLs to the main product URL. If each variant is effectively its own product (different photos, different search demand, such as a phone in different storage sizes that people search for separately), give each its own self-canonical page. Choose based on whether people search for the variant by name.

Syndicated and cross-domain content

Canonical tags can point to another domain, which is how you tell Google that an article on a second site you own is a copy of the original. Syndication with outside partners is different. In 2023 Google updated its guidance to say that the canonical tag is not recommended as the way to handle syndication partners, because the partner's page often differs (different navigation, comments, related content). Google's current advice is for partners to keep their copy out of the index with noindex, while linking back to your original. If a partner will only add a canonical, that is still better than nothing, but ask for noindex first.

International and hreflang pages

Each language or regional version should have a self-referencing canonical and hreflang annotations listing all versions. Do not canonicalise the German page to the English one; that tells Google the German page is a duplicate to be dropped, which contradicts the hreflang. Validate the pairing with the hreflang validator, which also flags canonical conflicts.

Canonical vs noindex vs 301 vs robots.txt

These tools overlap enough to be confused and differ enough that the wrong choice causes real damage.

ToolWhat it doesVisitors still see the URL?Use it when
301 redirectSends users and bots to another URL; strongest consolidationNoThe duplicate has no reason to exist for visitors (old URL, http, non-www)
rel="canonical"Suggests which URL to index; signals consolidateYesThe duplicate must stay reachable (parameters, variants, print views)
noindexKeeps the page out of results; no consolidationYesThe page should not appear in search at all and is not a copy of another page (thank-you pages, internal search)
robots.txt DisallowStops crawling; does not consolidate or removeYesSaving crawl effort on large numbers of low-value URLs

Two combinations to avoid:

  • canonical plus noindex on the same page. One says "this is a copy of that page, merge them", the other says "drop this page". Google has advised against using noindex as a way to choose a canonical within a site. Pick one.
  • canonical on a page blocked by robots.txt. Google cannot crawl the page, so it never sees the tag.

The indexability checker combines meta robots, X-Robots-Tag, robots.txt, canonical, and status code into one verdict, which is the quickest way to spot these contradictions on a single URL. For noindex specifically, the indexability checker reads both the meta tag and the HTTP header.

When Google Picks a Different Canonical

Because the canonical tag is a hint, Google sometimes overrides it. In Search Console, open the URL Inspection tool for the page and look at two fields: User-declared canonical (what your tag says) and Google-selected canonical (what Google chose). If they differ, work through the likely causes in this order:

  1. Conflicting signals. Do internal links, the sitemap, hreflang, and redirects all agree with the tag? Fix the disagreements first; this is the cause most of the time.
  2. The target is not healthy. Does the declared canonical redirect, return an error, carry noindex, or load very differently? Check it with the canonical and status tools.
  3. The pages are not really the same. If the "duplicate" has meaningfully different content, Google may decide it deserves its own index entry, or that another page is the better representative.
  4. The pages are too similar to tell apart. The reverse case: two pages you intended to be different (two city pages with the same text and only the city name swapped) can be folded together. The fix is genuinely distinct content; a full site audit is a quick first check for pages sharing the same titles and descriptions.
  5. Protocol or host preference. If both http and https versions are reachable, Google may prefer https regardless of your tag. Redirect http to https.

After fixing the cause, request indexing on the canonical URL and give it time. Google recalculates canonicals as it recrawls, which can take weeks on large sites.

Reading the Search Console Reports

The Page indexing report groups non-indexed URLs by reason. Three reasons relate to canonicals, and only one is usually a problem:

StatusMeaningAction
Alternate page with proper canonical tagThis URL points to another canonical, and Google agreedNone; this is canonicalization working
Duplicate without user-selected canonicalGoogle sees this as a duplicate and you declared no canonicalAdd a canonical (or redirect) so you choose, not Google
Duplicate, Google chose different canonical than userYou declared a canonical, Google picked another URLDiagnose with URL Inspection using the steps above

A large and growing "Alternate page with proper canonical tag" count is normal on stores and parameter-heavy sites. It becomes worth investigating only if URLs you expect to rank appear there, which means a template is pointing them at the wrong canonical.

Platform Notes

WordPress

  • WordPress core outputs a self-referencing canonical on single posts and pages.
  • SEO plugins such as Yoast SEO and Rank Math take over canonical output for all page types and let you set a custom canonical per post (usually in an "Advanced" section of the plugin's panel). Use the override only for genuine duplicates; leaving it blank keeps the self-reference.
  • Watch for themes that print their own canonical in addition to the plugin's. View the page source and search for rel="canonical"; there should be exactly one.

Shopify

  • Themes output the canonical through the canonical_url Liquid object in theme.liquid. Make sure your theme still includes it after customisation.
  • Products reached through a collection (/collections/name/products/handle) canonicalise to /products/handle, and variant URLs with ?variant= canonicalise to the main product URL.
  • Collection pages filtered by tag or by Shopify's storefront filters create many parameter URLs. Check what canonical your theme outputs for them before deciding whether any deserve to rank.

Next.js and other frameworks

In the Next.js App Router, set metadataBase once in the root layout and a canonical per page through the metadata API, which renders the tag in the server HTML:

// app/blog/[slug]/page.tsx
export async function generateMetadata({ params }) {
  const { slug } = await params;
  return {
    alternates: { canonical: "/blog/" + slug },
  };
}

Whatever the framework, the rule is the same: build the canonical from the known clean path, never from the incoming request URL with its parameters.

A Canonicalization Checklist

  1. One protocol and host, enforced with single-hop 301 redirects.
  2. One trailing-slash convention, enforced with redirects.
  3. A single, absolute, self-referencing canonical in the head of every indexable page.
  4. Duplicates (parameters, variants, alternate paths) canonicalised to the main URL.
  5. Paginated pages and language versions self-canonical.
  6. Internal links, the XML sitemap, and hreflang all using the canonical URLs.
  7. No page combining canonical with noindex, and no canonical target blocked, redirected, or broken.
  8. Search Console checked monthly for "Google chose different canonical than user".

These checks run across your whole site in a DarnItSEO site audit, and they appear alongside the rest of your technical setup in the SEO checklist and the broader technical SEO checklist. Consistent internal links are half the battle, so pair this guide with the internal linking guide.

Frequently Asked Questions

Is a canonical tag a directive?

No. It is a strong hint. Google usually follows it when the other signals agree, but it can and does choose a different URL when the signals conflict or the pages are not equivalent. A 301 redirect is the stronger option when the duplicate does not need to exist.

Does every page need a canonical tag?

It is not required, but a self-referencing canonical on every indexable page is a good default, because it handles unexpected parameter and tracking URLs automatically.

Do canonicalised pages pass link value?

When Google accepts the canonical, it consolidates signals such as backlinks from the duplicate URLs into the canonical one. That is the main benefit of canonicalization over simply letting duplicates exist.

Can I canonicalise to a page on a different domain?

Yes, cross-domain canonicals are supported and useful when you publish the same content on two sites you control. For third-party syndication partners, Google now recommends that the partner use noindex on their copy instead.

Should a canonical URL include query parameters?

Only if the parameter genuinely defines different content and that version should be indexed. For tracking, sorting, and session parameters, the canonical should be the clean URL without them.

How long does it take for Google to respect a new canonical?

Google has to recrawl both the duplicate and the canonical URLs and re-evaluate the group. On small sites this can be days; on large sites with many duplicates it can take weeks or longer. Consistent signals speed it up.

Does duplicate content cause a penalty?

Not in the sense most people fear. Ordinary technical duplication is not penalised. Deliberately copying other sites' content at scale to manipulate rankings is a different matter and falls under Google's spam policies on scraped content.