hreflang Tag Generator
Generate correct, reciprocal hreflang tags (with x-default) for every language version of a page.
Language versions
<link rel="alternate" hreflang="en" href="https://example.com/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />Paste this same block into the <head> of every language version — the set must be reciprocal to be valid.
What hreflang does
When your site exists in more than one language, search engines need to know which version to show which user. hreflang is how you tell them. Each page declares its alternates with <link rel="alternate" hreflang="…"> tags in the <head>, and Google uses them to serve the German page to German users and the French page to French users — instead of guessing or showing the wrong one.
How to use this generator
- Set your x-default URL — the fallback for unmatched users (often your homepage or language selector).
- Add one row per language version with its hreflang code (like
en-GBorde) and its full URL. - Copy the generated block and paste it into the
<head>of every language version of that page.
The rules that trip people up
1. hreflang must be reciprocal
Every page in the set must reference every other page — including itself. If your English page lists German and French but the German page doesn't list back, Google ignores the annotation entirely. That's why this tool outputs the full set to paste on each page.
2. Use valid language + region codes
The value is an ISO 639-1 language code, optionally with an ISO 3166-1 region (e.g. en, en-US, pt-BR). Don't invent codes like en-UK — the UK is en-GB.
3. Always include x-default
Without x-default, users outside your declared languages/regions get no clear signal. Point it at your best neutral entry page.
Doing this automatically
Maintaining reciprocal hreflang by hand across a growing site is error-prone — every new page and every new language multiplies the tags. A translation plugin like Gloty generates the correct hreflang set, canonical URLs, and translated meta for every page automatically, so you never hand-edit a tag again. See how it compares to Weglot and WPML.
Gloty emits correct, reciprocal hreflang (with x-default), canonicals, and translated meta automatically for every page — no hand-editing tags.