Canonical

Shopify Canonical Tags for Variants

Canonical prevents duplicate content. Shopify default handles it; custom edits carry risk.

Last updated: July 30, 2026By

Start free trialAdd as a preferred source on Google

Every Shopify variant can be reached at its own URL, but Google should usually treat them as one page. That's what the canonical tag does. Shopify sets it for you, and most of the canonical problems we see in support come from theme edits or apps that changed it without anyone noticing.

Shopify's default

Out of the box, Shopify outputs one canonical tag in the page head using the canonical_url Liquid object. For a product, that points to the clean product URL, for example /products/linen-apron, even when the shopper is looking at /products/linen-apron?variant=4242.

The result: all your color and size URLs pass their signals to one page, and Google shows that page in search. You don't need to configure anything. Products reached through a collection path such as /collections/aprons/products/linen-apron also canonicalize to the plain product URL.

Keep in mind that a canonical tag is a hint, not a command. Google usually follows it when the pages are near-duplicates, which variant pages almost always are. Our guide to duplicate content from variants explains why that's a good thing.

When to override

Changing the default is rarely worth the risk. Consider it only when all of these are true:

In most stores none of this holds. If one color sells like its own product, it's usually cleaner to make it a separate product with its own handle than to hack canonicals on a variant URL.

How to override

The canonical tag lives in theme.liquid (or a snippet it includes) as <link rel="canonical" href="{{ canonical_url }}">. To change it for certain variant URLs, a developer has to add Liquid conditions around that line, for example checking the current product and selected variant, and output a different URL in those cases. Note that variant IDs are a query parameter, not part of the path, so conditions that check request.path for the word "variant" won't work.

Duplicate your theme first, make the change on the copy, and preview it before publishing. Run a full SEO check after the change goes live.

Verification

  1. Open a product page with a variant selected and view the page source. Search for rel="canonical". There should be exactly one.
  2. Check that the href is the full product URL you expect, with no ?variant= unless you deliberately set that.
  3. In Google Search Console, run URL Inspection on the variant URL. Compare "User-declared canonical" with "Google-selected canonical".
  4. Repeat after any theme update or new SEO app install.

Common mistakes we see

Markets and languages

If you sell in several languages through Shopify Markets, each language version of a product should canonicalize to itself, with hreflang tags pointing to the other versions. Shopify handles this when you use its built-in language subfolders. Our guide to hreflang for variant URLs covers the setup and the mistakes that break it.

Canonical tags work best when everything else agrees with them. Your sitemap should list the product URL, not each variant URL; see our note on variants in the Shopify sitemap. Internal links in menus and blog posts should point to the clean product URL too.

Shopping feeds are a separate system. Google Merchant Center expects one item per variant, each with its own variant URL, and that's fine: the feed and the canonical serve different purposes. The Google Shopping variant feed guide explains how the two fit together.

Frequently asked questions

How does Shopify handle canonical for variants?

By default every variant URL canonicalizes to the main product URL. That keeps Google from treating each color or size as a duplicate page, and you don't need to set anything up.

Can I set canonical per variant?

Yes, with a theme code change around the canonical tag in theme.liquid. It's an advanced edit, so test it on a duplicate theme and check the result in Search Console.

Does canonical affect variant SERP visibility?

Yes. Ranking signals collect on the main product URL, so variants don't usually appear as separate search results. For most stores that's the outcome you want.

How to test canonical setup?

View the page source and look for one <link rel="canonical"> tag. Then use URL Inspection in Google Search Console to see which canonical Google selected.

Multiple canonical tags: problem?

Yes. With conflicting tags Google may ignore them all and pick its own canonical. This usually happens when an SEO app adds a tag the theme already outputs, so remove one of them.

Canonical with UTM parameters?

Your canonical should never include UTM parameters. Shopify's default canonical already strips query strings, so this only goes wrong with custom code.

Canonical for hreflang variants?

Each language version should canonicalize to itself and list the other languages with hreflang tags. Pointing every language to the English page tells Google to ignore the translations.

Does canonical affect Google Shopping?

No. Shopping feeds submit each variant as its own item with its own URL, separate from the canonical tag on the page.

Related reading

Sources & further reading

Primary sources referenced in this article. We link to official platform documentation and standards bodies rather than secondary summaries so you can verify claims directly.

Try it free on Shopify

Print It My Way's permanent Free plan includes live preview, custom options, and Cart Transform pricing.

Install Print It My Way