Home · The 15 signals · Hreflang on PDP

Shopify hreflang on PDPs for AI shopping agents

A UK shopper asks ChatGPT for "best wool runners under £100." Your store sells exactly that — but only your US PDP is in the agent's index. The agent surfaces your US product page, the user clicks through, sees prices in dollars, sees "ships internationally" friction, bounces. They go buy a competitor's UK-localized product. The signal that prevents this is hreflang — a small set of <link rel="alternate" hreflang="..."> tags in the <head> of every PDP that names every regional version of the page. AI shopping agents read them, route the user to the right region, and (importantly) consolidate ranking authority across regions instead of treating each language version as a separate competitor. For single-region stores it's a one-tag formality; for multi-region brands it's the difference between getting routed correctly and getting routed away.

Last updated 2026-04-30 · Deep signal · 4 pts

4 ptsRanking-spread weight
~62%Multi-region stores miss x-default
1 blockIn theme.liquid
What this signal scores: we view-source on a sampled PDP and count <link rel="alternate" hreflang="..." href="..."> tags in the <head>. Full credit (4 pts) for two or more locale tags plus an x-default tag pointing at the canonical fallback. Half credit (2 pts) for one locale tag (acceptable for single-region stores), or for two+ locales without x-default. Zero if missing entirely or if the tags reference URLs that 404, redirect, or point to themselves.

What it is

Hreflang is the IETF/W3C standard for declaring "this page exists in another language and/or region — here's the URL." It lives as a <link> tag in the <head>:

Correct — multi-region with x-default

What you want

<link rel="alternate"
  hreflang="en-US"
  href="https://store.com/products/foo">
<link rel="alternate"
  hreflang="en-GB"
  href="https://store.com/en-gb/products/foo">
<link rel="alternate"
  hreflang="de-DE"
  href="https://store.com/de/products/foo">
<link rel="alternate"
  hreflang="x-default"
  href="https://store.com/products/foo">
Half credit — single locale

Acceptable for single-region

<link rel="alternate"
  hreflang="en"
  href="https://store.com/products/foo">
Zero — missing

The default for many themes

<!-- Just a canonical, no hreflang at all -->
<link rel="canonical"
  href="https://store.com/products/foo">
Zero — wrong codes

What we still find

<link rel="alternate"
  hreflang="uk"
  href="https://store.com/uk/products/foo">
<!-- "uk" = Ukrainian, not United Kingdom -->

The language-region code rules

The hreflang attribute uses BCP 47 tags: a two-letter language code (ISO 639-1) optionally followed by a hyphen and a two-letter region code (ISO 3166-1 alpha-2). The most common confusions:

You probably wantCorrect codeCommon mistakeWhy it's wrong
United Kingdomen-GBen-UK or just ukuk is Ukrainian; en-UK isn't a valid combination
European Germande-DEde-EUEU is not a valid region code
Latin American Spanishes-419es-LATAM419 is the UN M.49 code; LATAM isn't valid
Brazilian Portuguesept-BRptBare pt matches all Portuguese including European
Region-only routingfull lang-region tagjust the region (US)The language part is required
Default fallbackx-defaultomit it entirelyWithout x-default agents don't know where to send unmatched regions

The x-default tag tells the agent "if no other tag matches the user's locale, send them here." Without it, an agent serving a French shopper your en-US + en-GB tagged page has to guess — and most guess by routing the user away to a competitor with cleaner hreflang.

Why AI shopping agents care

How to test it on your store

View source on any PDP. Search for hreflang=. Count and verify:

  1. One <link> per regional version, including the page you're currently looking at (yes, even the page itself should appear — hreflang is bidirectional).
  2. An x-default tag pointing at your canonical fallback URL (usually the homepage URL or the canonical-region PDP).
  3. Each href resolves with HTTP 200. Click each one or curl it; broken hreflang URLs are zero credit. The most common cause is a region's translated handle drifting after a re-localization.
  4. Reciprocal pairing. If the US PDP says "I have a UK alternate at X," the UK PDP at X should also list a US alternate pointing back. Asymmetric hreflang gets ignored by stricter agents.

Tools: paste the URL into Google Search Console's "URL Inspection" tool to see which hreflang Google parsed; or use any third-party hreflang validator. The CatalogScan free scan does pair-checking automatically and flags any unreciprocated tag in the report.

How to fix it

Single-region stores: emit one tag plus x-default5 minfree

If you sell only in the US and have no plans to localize, you don't need elaborate hreflang. Add this to layout/theme.liquid inside the <head>:

<link rel="alternate" hreflang="en" href="{% raw %}{{ canonical_url }}{% endraw %}">
<link rel="alternate" hreflang="x-default" href="{% raw %}{{ canonical_url }}{% endraw %}">

Half credit becomes full credit just for declaring the explicit fallback. Cost: 30 seconds of theme edit time.

Shopify Markets: built-in hreflang block15 minfree

Shopify Markets (the multi-region feature inside Shopify) emits a Liquid global called localization.alternate_versions that lists every regional version of the current URL. Drop this in layout/theme.liquid:

{% raw %}{% for alt in localization.alternate_versions %}
<link rel="alternate" hreflang="{{ alt.iso_code }}" href="https://{{ alt.shop_url.host }}{{ alt.shop_url.path }}">
{% endfor %}
<link rel="alternate" hreflang="x-default" href="{{ canonical_url }}">{% endraw %}

The iso_code on each alternate is the BCP 47 locale (e.g. en-GB) and matches what AI agents and search engines expect. The shipped x-default at the end points at your primary-market canonical. This is the minimum-edit, maximum-coverage hreflang block for any store on Shopify Markets.

Multi-store setup (separate Shopify stores per region)45 minfree

Some brands run separate stores per region — store.com, store.co.uk, store.de — instead of using Shopify Markets. Hreflang has to be maintained manually per store. Build a metafield on each product mapping locale → URL, render the link tags from that metafield in each store's theme.liquid. Or maintain a JSON manifest in a metaobject and read from it. The painful part is keeping URLs in sync as handles change; do periodic audits with the testing tool above.

Hydrogen / Next.js headless25 minfree

In your route loader, fetch localizations from the Storefront API for the product (localizations is a top-level field on Shopify's Storefront API products). Map each entry to a <link rel="alternate"> tag in the route's <Meta> or generateMetadata output. Don't forget the x-default. In Next.js App Router specifically, the alternates.languages field on the Metadata object handles this — passing { 'en-US': '...', 'en-GB': '...', 'x-default': '...' } emits the tags automatically.

5 mistakes operators keep making

1. Missing x-default on a multi-region setup

The single most common multi-region mistake. The store ships en-US, en-GB, de-DE tags but no x-default. A French or Japanese shopper hitting any of the regional PDPs gets routed by guess — usually to the version with the highest authority, which doesn't help conversion. Always add the x-default.

2. en-UK instead of en-GB

"UK" is the colloquial name; the ISO 3166-1 region code is GB. en-UK is a malformed BCP 47 tag and gets silently ignored by every parser. The store thinks it has a UK targeting tag; agents see no British-English version and route UK shoppers to the US page. Verify your codes against the ISO list before deploying.

3. Asymmetric pairing (US lists UK, UK doesn't list US)

The US PDP declares "I have a UK alternate at X," but the UK PDP at X has no hreflang at all — or lists only itself. Stricter parsers (Google, several AI agent indexers) drop unreciprocated tags. The fix is structural: maintain hreflang in one place (a metaobject, an env-driven config) and emit it on every regional store, not per-store ad-hoc.

4. Hreflang URLs that 404 after handle changes

Marketing rewrites the German handle from /de/products/wollrunner to /de/products/woll-runner for SEO. The German PDP redirects fine. But the US and UK PDPs still hardcode the old /de/products/wollrunner hreflang and now point at a 404. Strict parsers ignore broken hreflang. Re-emit hreflang from live data (the Liquid loop above does this automatically) instead of hand-curating URLs.

5. Region-only tags (hreflang="US")

The hreflang attribute requires a language at minimum; the region is optional but cannot stand alone. hreflang="US" is malformed and gets dropped. The correct form is en-US (or es-US for a Spanish-language US version). If you want to target by region without specifying language, you can't — emit one tag per language-region pair and an x-default.

See also

Are your hreflang tags actually pairing correctly?

Free 2-minute scan. We view-source your PDP, parse every hreflang tag, follow each href to verify it resolves, and check reciprocity across regional versions.

Scan my store → See all 15 signals