Skip to main content
Shugert Shopify Agency Logo

Shopify Hreflang Setup for Multi-Country Stores

Shopify hreflang setup for multi-country stores, covering Markets, URL structures, canonicals, sitemaps and validation checks that catch errors.

ShopifyUpdated 14 min read
Samuel Noriega
By

Published

ShareXLinkedIn
Shopify hreflang relationships connecting localized market URLs and x-default.

The international storefront is nearly ready to launch. Translations are published, regional pricing looks right, and the migration team has checked the homepage. Then a product crawl reveals French alternates pointing through redirects, British pages canonicalizing to the U.S. storefront, and localized products that aren't available in their assigned markets.

Shopify hreflang is a market architecture problem before it's a tag problem. For established DTC and B2B brands, the important work is connecting market configuration, equivalent resources, canonical destinations, and product availability. Automatic annotations reduce maintenance, but they don't establish that the underlying relationships are correct.

Table of Contents

How Shopify Generates Hreflang Tags from Markets

Shopify already generates hreflang from market and language settings. According to Shopify's international SEO documentation, configured domains, subfolders, and subdomains determine the annotations added to storefront pages; published languages also receive language-specific URLs and appear in XML sitemaps.

Each hreflang value identifies a language and, where configured, a region. A French-language destination might use fr, while regional English versions might use en-gb or en-us. The market's name alone isn't sufficient evidence of the generated value.

Hreflang output by market configuration

Market setupExample URLHreflang valueWhat to verify
Language-only marketyourstore.com/fr/frEach French page carries its own fr annotation
Region-qualified Englishyourstore.com/en-gb/en-gbRegion code matches the market, not just the language
Region-qualified Frenchyourstore.com/fr-ca/fr-caCanadian pricing and availability are live on the page
Subdomain marketfr.yourstore.comfrThe subdomain is assigned to the French market in Markets
Country-code domainyourstore.frLanguage-only or language-region value generated from its assignmentConfirm the generated value in the market settings before launch

These examples describe configuration patterns, not guaranteed paths. A country-code domain doesn't independently establish which language-region annotation Shopify will produce.

Keep generation under one owner

For a native Shopify or Shopify Plus storefront, Markets should normally remain the authoritative generator. Adding a custom Liquid block or another app before inspecting existing output creates additional maintenance without necessarily fixing the underlying assignment.

Conflicting generators are particularly difficult to troubleshoot when one references translated handles and another reconstructs URLs from the primary storefront. Both can produce plausible-looking tags while disagreeing about the correct destination.

Practical rule: Inspect the complete storefront head before installing anything intended to fix hreflang.

Automatic output is the baseline, not acceptance evidence. Before launch, record the exact generated value, assigned public URL, language, and intended audience for every market. That configuration record gives engineering and SEO teams a concrete reference instead of an assumption based on folder names.

Choose Subfolders, Subdomains or Country Domains

StructureExampleBest fitMigration impact
Subfoldersyourstore.com/fr/Most stores; simplest setup with no extra domain costSignals consolidate on one domain; redirects map to paths
Subdomainsfr.yourstore.comDistinct host names owned by regional teamsEach host needs its own redirect and analytics handling
Country-code domainsyourstore.frBrands wanting a clear country identitySeparate domain, redirect set, sitemap and analytics per market

Shopify supports all three. Subfolders are the simplest to run and need no extra domains; country-code domains give a clearer country signal at the cost of more domains to maintain.

Choose for operational ownership

Subfolders keep the public architecture concentrated on the main domain. They simplify shared reporting and reduce the number of separate domains the team must maintain, although analytics still needs a reliable market dimension.

Subdomains provide a useful organizational boundary when regional teams own distinct storefront responsibilities. They don't automatically create independent hosting inside a native Shopify store, and they still need explicit ownership for redirects, reporting, and release testing.

Country domains can support a strong local identity, but every additional domain adds operational work. Domain renewal, sitemap submission, redirect preservation, and reporting must remain assigned after the migration team leaves.

For a legacy-platform migration, paths such as /fr-fr/ and /de/ may not match the chosen destination pattern. Preserving the resource relationship matters more than preserving a familiar-looking prefix.

Separate stores need explicit relationships

Choose a consistent structure across the brand wherever commercial requirements permit. Mixing structures can be justified, but it multiplies mapping rules and exceptions.

Native Markets output shouldn't be assumed to connect independent Shopify stores. Cross-store annotations need a controlled resource map, an identified generator, and successful return relationships from the other storefront.

Complex ownership decisions belong in the Shopify Plus architecture scope, alongside ERP, B2B, and multi-store requirements. Before committing to launch, multiply market variants by template types, then confirm that the crawl and review process can cover that set within the release window.

How to Map Markets and Launch Localized URLs

A market-to-URL matrix connects commercial intent to individual storefront resources. It should identify what each localized page replaces, where it belongs, and which equivalent pages exist. The useful unit is the resource, not the market label: one product in three markets may need three URLs, one canonical decision, and three redirect relationships from the legacy catalog.

Build the launch map

  1. Create the resource-level matrix. Record the target market, language, assigned public base, localized resource URL, canonical destination, and legacy URL it replaces. Include a stable resource key so corresponding products remain connected even when handles differ.

  2. Assign each market deliberately. Connect the intended domain, subfolder, or subdomain to its language and market in Shopify Markets, then record the generated region qualification. A market label such as Canada does not prove that its public destination or hreflang value matches the launch plan.

  3. Publish the required languages. In Shopify's language settings, publishing a language creates language-specific URLs, adds hreflang automatically and allows translated URL handles. Publishing clears a technical dependency. Localized titles, descriptions, and merchandising decisions still need their own approval.

  4. Approve translated handles before final mapping. Record translated slugs as actual destinations rather than deriving them from the primary-language path. If a French product handle changes, an alternate constructed from the old handle can stop resolving to the intended product.

Preserve the migration relationship

  1. Build explicit old-to-new redirects. Cover important products, collections, content pages, blog resources, and former canonical destinations. Enabling a language does not preserve legacy paths, so every valuable incoming URL needs a deliberate destination rather than a blanket redirect to a regional homepage.

  2. Define the fallback journey. Record the intended x-default destination and compare it with live output. If they disagree, resolve the routing or generation policy instead of inserting a competing annotation.

  3. Crawl before cutover. Compare representative product, collection, page, blog, and pagination URLs against the matrix, including translated-handle and unavailable-product cases. Mark each row complete only when the URL resolves to its intended resource and its declared relationships match the approved mapping.

The matrix should also distinguish not offered, not translated, and not yet verified. Those states require different decisions, and treating them as interchangeable encourages teams to publish inappropriate alternates.

For a Shopify migration, this document belongs with redirect ownership and launch acceptance criteria, not in a separate localization spreadsheet. Engineering, merchandising, and SEO teams need the same resource relationships. Architecture and written scope should define the destination, data contracts, URL ownership, storefront implementation, milestones, and acceptance criteria before release.

A complete matrix is one where every published relationship is intentional and every absence is explained.

“Done” means the approved configuration matches storefront output and every mapped destination serves its intended page.

Hreflang Ownership on Headless and Custom Themes

The critical distinction is which system owns the HTML head. Native Liquid themes and custom storefront applications don't share the same implementation responsibility.

Google's localized-version guidance supports HTML link elements, HTTP headers, and XML sitemap annotations. These methods express equivalent localized resources; they don't repair incorrect resource mapping.

Native Liquid themes

In a standard Online Store theme, Shopify's generated annotations reach the page through content_for_header, rendered within layout/theme.liquid. When hreflang disappears after a theme release, that integration point should be inspected before anyone builds replacement tags.

A concrete failure mode is a custom head rewrite that omits the required object. Restoring the platform integration is the appropriate investigation, rather than pasting hardcoded alternate URLs into every template.

The review should also identify app-generated and custom Liquid annotations. Removing the entire header object isn't an appropriate way to eliminate an unwanted hreflang block because that object serves broader platform responsibilities.

Hydrogen and custom frontends

A headless application must explicitly generate its international metadata. Its central SEO configuration should map supported locales, market domains, localized routes, canonical destinations, and resource-level alternatives.

Prefix replacement isn't a resource map. An English handle and its translated equivalent may differ, and a product may exist in one market but not another. A route resolver needs the validated destination set for that resource, not a string transformation that assumes every path exists.

Localized product and collection data can come from the Storefront API where appropriate. The application still owns the relationship between that data, the public route, and the metadata rendered for the request.

  • Render on the server. Include annotations in the initial HTML head rather than depending on a later client-side update.
  • Test route context. Ensure cached metadata doesn't expose another market's canonical or alternates.
  • Assign maintenance ownership. Route changes and catalog availability updates must reach the mapping layer.
  • Retire obsolete generators. A return from headless to native Liquid should remove custom output before native annotations become authoritative.

A missing alternate is visible during inspection. A valid-looking alternate generated from the wrong cached market context is harder to detect, which makes deployment fixtures essential.

How to Validate Every Hreflang Cluster

A 200 response can still serve the wrong currency or an unavailable product. Automatic generation doesn't remove the need to check output. Start with representative URLs from each template, then compare the rendered cluster against the market matrix.

CheckTestFailure it catches
Absolute resolvable alternatesFetch every alternate and confirm HTTP 200 on the intended resourceRelative, redirecting or 404 targets
Reciprocal relationshipsConfirm each alternate links back, including the page's own self-referenceOne-way or orphaned clusters
Canonical and indexabilityConfirm each intended localized search page canonicalizes to itself and is eligible for indexingAlternate canonicalized to another market
Code formatCheck supported language-region formats such as en-US, es-MX and es-ESMalformed or unsupported values
x-default destinationConfirm the fallback matches the routing strategy in the matrixFallback pointing at the wrong market
Semantic matchCompare rendered language, currency and availability with the matrix rowCorrect status code but wrong market or product

Automate relationships, inspect meaning

Use a crawler that extracts annotations, identifies missing return links, and records destination responses. For large catalogs, add a validation script that groups URLs by resource key and compares each cluster with the approved market set. That catches structural breaks at scale: a translated handle that never received a return link, a market removed from the matrix but left in template output, or a canonical that points to a regional URL nobody intended to index.

Compare coverage against localized sitemap URLs. Where sitemap hreflang annotations are implemented, their relationships should agree with HTML output. Ordinary sitemap inclusion only confirms discovery. It says nothing about whether the alternate declaration matches the rendered market page.

The technical result and the commercial result can diverge. A request may return 200, carry valid es-MX values, and still show USD prices, English copy, or a product that is unavailable in Mexico. Those failures sit in technical SEO acceptance criteria for Shopify international stores, where URL behavior, canonical intent, redirects, and product availability are checked together.

Use a regression set after deployments, redirect changes, translated-handle edits, and market reconfiguration. Keep it small enough that someone can review the output line by line, and broad enough to cover at least one product, collection, and non-product template per market. Once that set is stable, the same checks can run on every release without turning hreflang validation into a manual guessing exercise.

Fix Canonical Conflicts and Same-Language Markets

More country tags don't automatically produce better rankings. Once annotations look correct, the harder question is whether the destination deserves to exist as an independently indexable regional page. Canonical rules, redirects, market availability, and rendered content decide whether that page has a real job.

SymptomLikely causeFix
Alternate's canonical points to another marketCanonical rule collapses markets into one versionMake each intended localized search page canonical to itself and align the hreflang target
Alternate redirects or returns 404Translated handle changed or mapping missingPoint hreflang to the final URL in the matrix
Product annotated in a market where it is unavailableMarket availability not reflected in alternatesRemove that alternate or build the legitimate localized product page
Two countries with identical English pagesCountry tags added without material differencesConsolidate, or differentiate currency, shipping, tax, sizing or terminology

Resolve contradictory publishing intent

A regional URL that declares another market as canonical sends a consolidation signal while hreflang presents it as a localized alternative. If independent regional indexation is the objective, correct the canonical rule at its source rather than patching individual products.

If consolidation is intentional, choose one destination per resource and align the alternates to that decision. Teams should avoid forcing self-referencing canonicals onto duplicate URLs when the commercial intent is a single indexable version. The canonical rule and the hreflang cluster should express the same architecture.

Availability needs the same discipline. Out-of-stock products keep their localized URL. Products excluded from a market do not get an alternate. A temporary inventory gap and a market exclusion are different states, and the annotation set should reflect the approved market matrix rather than the current stock status alone.

Require a commercial reason for regional URLs

Hreflang distinguishes language-only and region-qualified annotations. That distinction matters for countries sharing English, French, German, or Spanish, but a tag does not localize pricing, delivery promises, tax treatment, sizing, inventory, spelling, or buying intent.

Regional URLs earn their place when shoppers see real differences: fulfillment coverage, regulatory information, terminology, currency or catalog availability. A country code on otherwise identical content only adds URLs to maintain.

Regional annotations describe a localized experience. They don't create one.

The x-default destination serves unmatched language or regional preferences. Its job is routing, while each live market page still needs its own commercial basis and canonical policy.

After search engines recrawl the changes, review country-filtered search performance and inspect representative regional URLs for indexing and selected canonicals. Country-level performance and URL-level indexation answer different questions, so both need review before the team attributes a visibility problem to hreflang.

Confirm Your Hreflang Setup Before the Next Launch

Approve the release only after the intended market architecture, the live output, and the commercial rules agree. A tag review that ignores the destination plan will tell you whether annotations exist. It will not tell you whether they describe the store you are about to launch.

Make release approval evidence-based

  1. Confirm the decision owner. Name the team responsible for approving market routes, canonical policy, and product availability before cutover.
  2. Check the release state. Run the review against the accessible preview or live storefront, then compare the result with the approved configuration record from section 1.
  3. Apply the validation checklist. Use the template, locale, redirect, canonical, and recrawl checks from section 5. Resolve failures in the affected resource and locale rows before sign-off.
  4. Review commercial context. Confirm that market availability and canonical treatment match the intended customer experience, including pricing, delivery, terminology, and catalog differences.
  5. Monitor after recrawl. Review country-level search performance and URL-level indexing evidence separately after launch.

Internal review is often sufficient for a stable storefront with limited international complexity. Outside help becomes more useful when regional ownership is fragmented, a migration remains in progress, or unexplained indexing changes coincide with theme, app, and routing modifications.

Shugert takes over existing Shopify stores, and most engagements start with an audit of the current theme and apps. That starting point matters when no single team can explain which system currently generates international metadata.

The matrix should remain a living release document, owned by the team responsible for changing markets or URLs. Its owner should update it when a route changes, a product leaves a market, or a language is retired, not after the next crawl exposes the mismatch.


Shugert offers migration, engineering, and technical SEO support for established Shopify and Shopify Plus brands, including international setups where Markets, themes, apps, and URL ownership need coordinated review. Its free Shopify audit checks performance, technical SEO, buying-experience, and AI-readability for a store URL; visit Shugert to start with that scan and discuss whether a deeper market-architecture review fits the next launch.

ShareXLinkedIn

Ready to turn this into work?

Scope a fixed-price Shopify engagement

We define deliverables, exclusions, acceptance criteria, price and validation before implementation begins.

Keep reading

On this page▾