How to use it
- 1
Add one row per language version with its language code and full URL.
- 2
Set an x-default URL for visitors whose language you do not offer.
- 3
Fix any warnings about codes, URLs or duplicates.
- 4
Place the same block on every version, or use the sitemap format instead.
How hreflang works
Hreflang tells search engines that pages are translations or regional variants of each other, so a German searcher gets the German page. The annotations must be reciprocal: if page A points to page B, page B must point back to A, and every page must list itself.
Codes are a language (ISO 639-1, like “de”) optionally followed by a region (ISO 3166-1, like “de-AT”). A region alone (“AT”) is invalid.
Questions
HTML tags or sitemap?
Either works. Sitemaps are easier for large sites because the annotations live in one file instead of every page.
Is “en-UK” valid?
The format is valid but the region code for the United Kingdom is GB, so use “en-GB”.
Do I need x-default?
It is optional but recommended: it tells search engines which page to show when no listed language matches.
Updated:
