How to Set Up Hreflang Tags on Shopify

Set up hreflang tags on Shopify for international stores. Using Shopify Markets, apps, and manual approaches for multi-language stores.

Shopify's hreflang situation has improved significantly since the introduction of Shopify Markets, but it still has real limitations depending on your store setup. Here's what actually works and where each approach falls short.

Method 1: Shopify Markets (built-in, recommended)

Shopify Markets is Shopify's native international commerce feature, available on all plans. When you set up multiple markets with different languages or currencies, Shopify automatically adds hreflang tags to your storefront.

1

Set up Shopify Markets

In your Shopify admin, go to Settings > Markets. Create markets for each country or region you're targeting. Assign languages and domains or subfolders to each market.

2

Configure your URL structure

Shopify Markets supports two URL approaches: subfolders (example.com/fr/) or separate domains (example.fr). Both work with hreflang. Subfolders are simpler to manage; separate domains give stronger geographic signals.

3

Add translated content

Use Shopify's built-in translation management or the Translate & Adapt app (free) to add translated product descriptions, page content, and navigation. Shopify Markets handles hreflang based on the market and language configuration -- not on whether every piece of content is translated.

4

Verify hreflang output

Visit a product or collection page on your live store, view source, and check for <link rel="alternate" hreflang="..."> tags in the <head>. Shopify should output a complete set including a self-reference for each market.

What Shopify Markets does well: Automatic hreflang generation, self-referencing tags, reciprocal links handled correctly, x-default included.

Limitations: The hreflang is tied to market configuration. If you need hreflang at a level of granularity Markets doesn't support (e.g., en-AU vs en-NZ as separate subfolder/domain setups within one "English" market), you'll need to go manual.

Shopify Markets is the right default

If you're setting up a new international Shopify store, start with Markets. It handles hreflang correctly and saves you from maintaining it manually. Only look at third-party apps or manual approaches if Markets can't cover your specific configuration.

Method 2: Third-party apps

If you're on an older Shopify setup without Markets, or if you need more granular control, third-party apps can manage hreflang for you.

Hreflang Manager -- Purpose-built for hreflang on Shopify. Lets you configure language/region targeting and outputs hreflang tags through a theme script injection. Good for stores that aren't using Shopify Markets but need correct hreflang across many pages.

Langify -- A translation app that also handles hreflang. It creates translated storefronts and manages the hreflang relationships between them. Predates Shopify Markets and is a complete solution for stores that needed multilingual support before Markets existed.

Weglot -- Translation management platform with Shopify integration. Generates translated pages and handles hreflang automatically. More expensive than other options but has good support for complex multilingual setups.

App + Markets conflicts

Don't run a third-party hreflang app simultaneously with Shopify Markets hreflang. You'll end up with duplicate or conflicting hreflang tags in the page source. Pick one approach and disable the other.

Validate your Shopify hreflang

After setting up Markets or an app, use Hreflang Generator to confirm your tags are complete and correct.

Method 3: Manual via theme.liquid

For stores that need precise control or have unusual configurations, you can add hreflang tags directly to your theme's theme.liquid file.

In your Shopify admin, go to Online Store > Themes > Edit code > Layout > theme.liquid. Inside the <head> section, add your hreflang tags:

{% if template == 'index' %}
  <link rel="alternate" hreflang="en" href="https://example.com/" />
  <link rel="alternate" hreflang="fr" href="https://example.fr/" />
  <link rel="alternate" hreflang="x-default" href="https://example.com/" />
{% endif %}

For a more dynamic approach across product and collection pages, you'd need to use Liquid conditionals to output the right URLs for each template. This gets complex quickly.

When manual makes sense:

  • You have a very small number of pages to manage
  • Your URL structure is unusual and doesn't fit Markets' patterns
  • You need hreflang for specific page types only

When manual doesn't make sense:

  • Any store with more than a handful of products
  • Ongoing content additions (you'll need to maintain the tags manually every time)
  • Stores already using Shopify Markets

Comparison

ApproachSetup effortMaintenanceAccuracyBest for
Shopify MarketsLowAutomaticHighMost international stores
Third-party appsMediumLowHighPre-Markets stores, complex configs
Manual theme.liquidHighManualDepends on youVery small or unusual setups

Validating your Shopify hreflang

Whichever method you use, validate before you consider it done:

  1. Visit your store's homepage, a product page, and a collection page
  2. View source on each (Ctrl+U in most browsers)
  3. Search for hreflang in the source
  4. Confirm: self-referencing tag present, all markets/languages referenced, all URLs are absolute, no duplicate tags

Run the same check on your translated/regional pages. The return link requirement applies to Shopify just as much as any other platform -- every page in the hreflang cluster must reference every other page.


Part of Boring Tools -- boring tools for boring jobs.

Generate perfect hreflang tags

Create and validate hreflang markup for your multilingual site. Free.