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.
<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>:
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">
Acceptable for single-region
<link rel="alternate" hreflang="en" href="https://store.com/products/foo">
The default for many themes
<!-- Just a canonical, no hreflang at all --> <link rel="canonical" href="https://store.com/products/foo">
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 want | Correct code | Common mistake | Why it's wrong |
|---|---|---|---|
| United Kingdom | en-GB | en-UK or just uk | uk is Ukrainian; en-UK isn't a valid combination |
| European German | de-DE | de-EU | EU is not a valid region code |
| Latin American Spanish | es-419 | es-LATAM | 419 is the UN M.49 code; LATAM isn't valid |
| Brazilian Portuguese | pt-BR | pt | Bare pt matches all Portuguese including European |
| Region-only routing | full lang-region tag | just the region (US) | The language part is required |
| Default fallback | x-default | omit it entirely | Without 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
- Region routing without geoIP guessing. Agents observing the same product across multiple Shopify regional storefronts use hreflang to decide which one to surface to a given user. Without it, the agent guesses based on the user's locale and the URL's TLD — which fails for stores on a single
.comwith sub-paths per region (the Shopify Markets default). - Authority consolidation across regions. Without hreflang, an agent treats
store.com/products/fooandstore.com/en-gb/products/fooas two separate products competing for the same query. Authority splits, neither version ranks well. With hreflang declared properly, the agent recognizes the relationship and consolidates ranking signals across all regional versions. - Conversion via locale match. An agent that surfaces your UK PDP to a UK shopper gets a higher click-through and conversion than one that surfaces your US PDP. Higher conversion to AI-referred traffic improves your prior on the next ranking decision (agents observe and learn from outcome quality).
- x-default catches the long tail. The
x-defaulttag is the explicit "I don't have a specific region for this user — send them to my main store." Agents prefer explicit fallback declarations over the implicit "pick whatever" default, especially for unusual locales (Estonian shopper on a US-UK-DE store).
How to test it on your store
View source on any PDP. Search for hreflang=. Count and verify:
- One
<link>per regional version, including the page you're currently looking at (yes, even the page itself should appear — hreflang is bidirectional). - An
x-defaulttag pointing at your canonical fallback URL (usually the homepage URL or the canonical-region PDP). - Each
hrefresolves 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. - 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
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 (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.
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.
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
- The 15 signals — full reference
- Canonical URL on PDP (the related signal — hreflang and canonical work together to consolidate authority across URL shapes and regions)
- Sitemap.xml (the second discovery surface where hreflang can also be declared, via
xhtml:linksub-elements) - Structured data validity (the per-page schema validity that breaks when hreflang URLs are wrong and parsers cascade-ignore)
- The full 18-signal Agentic Storefronts checklist
- Leaderboard: 100 DTC stores scored on hreflang and 14 other signals
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.