International SEO

Shopify Hreflang for Variant URLs

Hreflang tells Google which version of a page to serve to which language and region. Get it right and your Spanish-market product page ranks in google.es, your German-market page ranks in google.de, and Google understands they are equivalents — not duplicates. Get it wrong and Google indexes the wrong URLs in the wrong markets, or worse, treats the whole set as duplicate content and demotes all of them. Here is the exact Shopify Markets hreflang setup and the errors that trip up multi-region personalization stores.

Last updated: August 23, 2026~11 min readBy the Print It My Way team

What hreflang does (and what it doesn't)

Hreflang is a signal to Google that says "this URL is the localized version of this other URL for this language and region." It does not affect ranking directly — it affects which URL Google chooses to display to a searcher in a given country. Without hreflang, Google guesses based on ccTLD, language, and links. With hreflang, Google gets an explicit map. For personalization stores serving multiple markets, this is the difference between your Canadian buyer seeing the /en-ca product page (with CAD pricing and CA-specific shipping) vs the /en-us page (with USD pricing that then triggers currency confusion at checkout).

Shopify Markets generates hreflang automatically

When you set up Shopify Markets with per-market domains, subdomains, or subfolders, Shopify auto-generates hreflang tags in every product page's HTML. Verify by viewing source on any product page — you should see:

<link rel="alternate" hreflang="en-us" href="https://www.example.com/products/mug" />
<link rel="alternate" hreflang="en-gb" href="https://www.example.com/en-gb/products/mug" />
<link rel="alternate" hreflang="fr-fr" href="https://www.example.com/fr-fr/products/mug" />
<link rel="alternate" hreflang="de-de" href="https://www.example.com/de-de/products/mug" />
<link rel="alternate" hreflang="x-default" href="https://www.example.com/products/mug" />

The x-default entry is required — it's the fallback when Google can't match a searcher's language/region to any of your explicit variants.

Per-variant URL handling

Variants in Shopify are typically referenced via query string: /products/mug?variant=1234567890. Variants do not get their own URLs in the sitemap or their own hreflang tags — the parent product's hreflang applies. If your personalization variants are actually meaningful SKUs (a "Small mug (US)" vs "Small mug (EU)" that ship from different warehouses), you may want separate products per region rather than variants, so each gets its own hreflang map. This is the #1 hreflang mistake in multi-region personalization stores.

The four hreflang errors GSC flags

1. "No return tags" (bi-directional missing)

Every hreflang link must be reciprocated. If /en-us/products/mug points to /en-gb/products/mug as its GB alternate, then /en-gb/products/mug must point back to /en-us/products/mug as its US alternate. Shopify Markets handles this automatically for markets published under Markets, but breaks if you have custom-added market variants (e.g., an AR-market product page you manually built).

2. "Invalid hreflang value"

Language codes must be ISO 639-1 lowercase, region codes ISO 3166-1 alpha-2 uppercase. Common mistakes: "en_US" (underscore instead of hyphen), "EN-us" (case wrong), "eng-usa" (three-letter codes). Correct form: en-US.

3. Missing x-default

Google penalizes hreflang sets without a fallback. Add x-default pointing to your primary market's URL.

4. Conflicting canonical + hreflang

If /en-gb/products/mug has a canonical pointing to /products/mug (which it shouldn't — Shopify Markets sets self-canonical), the hreflang from /en-gb becomes ambiguous. Each market URL must self-canonical.

Sitemap-level hreflang alternative

You can also declare hreflang in your sitemap XML instead of (or in addition to) HTML head tags. This is useful if your theme's head is bloated and you want to reduce per-page HTML weight. Shopify's auto-generated sitemap includes hreflang in the sitemap XML by default when Markets is configured with multiple markets.

<url>
  <loc>https://www.example.com/products/mug</loc>
  <xhtml:link rel="alternate" hreflang="en-us" href="https://www.example.com/products/mug" />
  <xhtml:link rel="alternate" hreflang="en-gb" href="https://www.example.com/en-gb/products/mug" />
  <xhtml:link rel="alternate" hreflang="fr-fr" href="https://www.example.com/fr-fr/products/mug" />
  <xhtml:link rel="alternate" hreflang="x-default" href="https://www.example.com/products/mug" />
</url>

The subfolder vs subdomain vs ccTLD decision

StructureExampleHreflang effortSEO signal strengthSetup complexity
Subfolderexample.com/en-gb/Auto (Shopify Markets)Domain authority sharedLow (native)
Subdomainuk.example.comAuto (Shopify Markets)Partial DA sharingMedium (DNS + Markets)
ccTLDexample.co.ukManualStrongest local signalHigh (separate Shopify store)

Most personalization stores start with subfolders — least friction, Shopify Markets handles hreflang automatically, DA accumulates on one domain. Move to ccTLDs only when local ranking pressure requires it (usually true in Germany, France, and Brazil where ccTLDs materially outrank .com equivalents).

Multi-language on same market

If you serve English + Spanish to the US market, use language-only hreflang (en, es) alongside region-scoped variants (en-US, es-US). Google will match based on searcher language, not just region.

Frequently asked questions

Does Shopify Markets generate hreflang automatically?

Yes — when you enable multiple markets with domains, subdomains, or subfolders, Shopify auto-injects hreflang tags into every product, collection, and CMS page's HTML head, and includes them in the sitemap XML.

Do Shopify product variants need their own hreflang?

No — variants share the parent product's hreflang. If your variants are meaningfully region-specific (different SKUs per region), consider making them separate products so each gets its own hreflang map.

What is x-default and do I need it?

x-default is the fallback URL Google serves when a searcher's language/region matches none of your explicit hreflang variants. It's not strictly required, but Google's own guidelines say to include it, and hreflang sets without x-default sometimes trigger GSC warnings.

How do I fix "no return tags" hreflang errors in GSC?

Every URL in a hreflang set must reciprocally link back to every other URL. If /en-us points to /en-gb, then /en-gb must point back to /en-us. Shopify Markets handles this automatically; the error usually appears when you have a manually-added market page that isn't part of Markets.

Should I use subfolders, subdomains, or ccTLDs for multi-region Shopify?

Subfolders (example.com/en-gb/) for most cases — least friction, DA shared. ccTLDs (example.co.uk) only when local search ranking pressure requires it, and only if you're prepared to run separate Shopify stores per country.

Can I use hreflang without Shopify Markets?

Yes — you can manually inject hreflang tags via theme code, but you lose Shopify Markets' auto-reciprocation, per-market pricing/currency, and sitemap integration. Not recommended unless you have an unusual setup.

What ISO codes should I use for hreflang?

Lowercase ISO 639-1 language + uppercase ISO 3166-1 alpha-2 region, hyphen-separated: en-US, fr-FR, zh-CN. Not underscores, not three-letter codes, not mixed case.

Does hreflang affect ranking or just which URL is displayed?

Just which URL is displayed. Hreflang is a canonicalization signal — it tells Google these are equivalents, so pick the right one for the searcher. It doesn't boost any single URL's ranking directly.

Related reading

Try it free on Shopify

Print It My Way's permanent Free plan works with Shopify Markets' hreflang, per-market variants, and multi-language personalization out of the box.

Install Print It My Way