How to Fix Duplicate Variant URLs on Shopify & WooCommerce

errorThe Problem

Your product variants (sizes, colors, etc.) create separate indexable URLs like /products/shirt?variant=12345. Each variant URL shows essentially the same content as the main product page, creating duplicate content that confuses Google and dilutes your ranking power.

trending_upWhy It Matters for SEO

A single product with 5 color options and 4 sizes creates 20 variant URLs — all competing against each other in Google's index. Instead of one strong product page, you have 20 weak ones. This is one of the most common and damaging SEO issues on ecommerce stores, especially Shopify.

buildHow to Fix It

  1. 1

    Shopify handles canonical tags on variant URLs automatically in most themes — they should point back to the main product URL.

  2. 2

    Verify: visit a variant URL (?variant=xxxxx) and view source. Search for 'canonical' — it should point to the base product URL without the variant parameter.

  3. 3

    If your theme doesn't include variant canonicals, add them in theme.liquid.

  4. 4

    Make sure variant URLs are NOT in your sitemap. Shopify's default sitemap excludes them, but some apps or custom sitemaps may include them.

  5. 5

    Use robots.txt to block variant URL patterns if canonical tags aren't sufficient.

folderlayout/theme.liquid (inside <head>)
<!-- In layout/theme.liquid, ensure this canonical tag exists in <head>: -->
<link rel="canonical" href="{{ canonical_url }}">

<!-- Shopify's {{ canonical_url }} automatically strips variant parameters -->
<!-- So /products/shirt?variant=123 canonicalizes to /products/shirt -->

<!-- If you need to explicitly handle it: -->
{% if request.path contains "products" %}
  <link rel="canonical" href="{{ shop.url }}{{ request.path }}">
{% endif %}
menu_bookRead Google's official documentationopen_in_new

Related Fix Guides

Want to check if YOUR store has this issue?

Scan your site for free — get copy-paste fixes in 60 seconds.

searchScan Now — It's Free