Skip to content

Misc

Hreflang on Shopify: what the theme does and what you fill in

Published

What hreflang does on a Shopify store

Hreflang tags tell Google and Bing which URL serves which language and region. On a multi-region or multilingual Shopify store, hreflang prevents duplicate-content issues (the English and German PDPs aren't the same page; they're alternates) and routes search-result clicks to the user's correct locale. Shopify's dev docs document hreflang as one of three SEO theme topics — themes are expected to emit hreflang tags automatically on multilingual or multi-domain stores, and most modern themes do.

Shopify's dev docs SEO overview1 lists 'Hreflang Tags' as one of three documented theme SEO topics (alongside SEO Metadata and Robots.txt Customization). The dev docs treat hreflang as a theme-emitter responsibility — the theme reads the store's Markets and languages configuration and renders the appropriate <link rel="alternate" hreflang="..."> tags in every page's <head>.

What the theme does for you automatically

Modern Shopify themes (Dawn 2.0+ and most premium themes built since 2023) auto-emit hreflang tags based on the store's Markets configuration. For each page, the theme outputs one <link rel='alternate' hreflang='language-region' href='...alternate URL...'> tag per active locale, plus a self-referencing hreflang for the current page. The theme also emits the x-default fallback tag. You don't write any code — you configure Markets, and the theme handles the rest.

html Auto-emitted hreflang tags in head, multi-market store
 <link rel="alternate" hreflang="en-us" href="https://yourbrand.com/products/handle" /> <link rel="alternate" hreflang="de-de" href="https://yourbrand.de/products/handle" /> <link rel="alternate" hreflang="fr-fr" href="https://yourbrand.fr/products/handle" /> <link rel="alternate" hreflang="x-default" href="https://yourbrand.com/products/handle" /> 

The auto-emitted set covers the common cases. Sub-folder Markets stores (yourbrand.com/de) get the same pattern with sub-folder paths in the href. Multi-domain stores get fully-qualified URLs per domain. The theme reads the Markets settings to know which locales exist and what their URLs are.

What you fill in — the Markets configuration

The hreflang configuration on Shopify happens upstream of the tags — in Markets. Settings > Markets is where you define the regions you sell to, the languages active per region, and the URL routing (multi-domain or sub-folder). The theme reads this config to emit hreflang automatically. If a hreflang tag is missing or wrong, the fix is almost always in Markets, not in theme code.

Three Markets settings that drive hreflang correctness. (1) The region's countries — hreflang's region component (en-US, de-DE) maps to the Markets region. (2) The language per region — hreflang's language component (en, de, fr) maps to active Markets languages. (3) The URL routing — multi-domain (yourbrand.de) vs sub-folder (yourbrand.com/de) sets what URL the theme emits in the hreflang href.

The x-default tag — Shopify's default behaviour

x-default is a special hreflang value that tells Google which URL to show when no other hreflang matches the user's locale. Per Google's hreflang documentation, x-default is recommended on every internationalised page. Shopify themes auto-emit x-default pointing to the primary domain's version of the page — typically the .com URL on multi-domain stores, or the bare path on sub-folder stores. You don't configure this manually; the theme reads the primary domain from Settings > Domains.

What x-default solves: a buyer from Switzerland searching in English gets routed to en-US, not to nothing. A buyer from Singapore browsing in Mandarin gets the x-default page if there's no zh-SG-specific URL. The fallback prevents the worst case (no result shown for an unmapped locale) at the cost of the buyer landing on a non-localised page. Shopify's default behaviour — x-default to the primary domain — is right for most stores.

Validation and common errors

Three common hreflang errors on Shopify stores. (1) Missing return tags — every alternate must point back to itself. The theme auto-emits these; manual additions sometimes don't. (2) Wrong region code — using 'gb' when Google expects 'gb' (correct ISO 3166-1) or 'uk' (incorrect). (3) Hreflang on pages that don't have localised equivalents — pointing en-US/products/handle hreflang to de-DE/products/handle when the de-DE store doesn't have that product.

Validation tools: Google Search Console > Indexing > International Targeting reports hreflang errors per property. Bing Webmaster Tools has a similar report. Third-party tools (Merkle's hreflang validator, Sitebulb) crawl your domains and surface missing return tags or mismatched alternates. Shopify's auto-emission handles most of these correctly on modern themes — errors usually mean Markets is misconfigured or a custom theme has broken the hreflang emitter.

One Shopify-specific gotcha: the multilingual sitemap auto-add behaviour from Shopify's find-site-map doc2"these languages are added automatically to the sitemap files" — means your sitemap should already include the alternate URLs. If the sitemap doesn't list them, Markets isn't fully configured for storefront publication. Verify Markets before assuming the sitemap is broken.