← All tools

Free generator

Hreflang Tag Generator

Enter your store URL, the page path, and your languages. The generator writes the full set of hreflang link tags — including the self-reference and x-default — for a subfolder URL structure.

Tags for this page (subfolder structure, /fr/, /de/, …)

<link rel="alternate" hreflang="en" href="https://example.com/products/linen-crew-tee" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/products/linen-crew-tee" />
<link rel="alternate" hreflang="de" href="https://example.com/de/products/linen-crew-tee" />
<link rel="alternate" hreflang="es" href="https://example.com/es/products/linen-crew-tee" />
<link rel="alternate" hreflang="x-default" href="https://example.com/products/linen-crew-tee" />

Every language version must carry the full set, including a tag pointing at itself, and the URLs must return 200. On Shopify, Markets subfolders get hreflang automatically — hand-rolled tags are for custom setups and edge cases.

Runs in your browser. Nothing you enter is stored or sent.

What hreflang actually does

Hreflang tells search engines which URL serves which language or region, so French shoppers land on /fr/ instead of your English page. It consolidates signals between the versions rather than splitting them — without it, translated pages can compete with each other or look like duplicates.

Why hreflang breaks so often

The rules are strict: every version must list the full set including itself, tags must be reciprocal across all versions, URLs must return 200, and codes follow ISO formats (language, optionally language-REGION). On Shopify, Markets handles hreflang automatically for its subfolders — generate tags by hand only for custom setups.

Full walkthrough: Hreflang on Shopify: what it is and when to touch it.

More guides on this topic

Compare apps

Doing this for every product?

See how LinguaFlow handles it for you.

Explore LinguaFlow →

Frequently asked questions

Does Shopify add hreflang tags automatically?

Yes — when you use Shopify Markets with its subfolder or domain setup, Shopify outputs hreflang for each published language and market on its own. Hand-written tags are only needed for setups outside Markets, headless builds, or edge cases where the automatic output is wrong.

What is x-default in hreflang?

A fallback: the URL search engines should show when no language version matches the searcher. Point it at your primary or language-selector page. It's optional but recommended, and this generator includes it by default.

Why are my hreflang tags not working?

The usual culprits: versions that don't link back to each other (hreflang must be reciprocal), missing self-references, URLs that redirect or 404, and invalid codes — it's en-GB and fr, not en-UK or french. Search Console's international targeting reports and a crawler like Screaming Frog surface all of these.

Should I use hreflang for the same language in different countries?

Only when the pages genuinely differ — currency, prices, shipping, spelling. en-US and en-GB versions with distinct content are a correct use. If the pages are identical, one URL with a single en tag is simpler and avoids near-duplicate maintenance.

Related tools

All 30 free tools →