hreflang/SKILL.md
Facts to use
- hreflang tells Google which URL is for which language or region. Three methods: HTML
<link rel="alternate" hreflang="...">tags, HTTP headers, or the sitemap. Google treats them as equal. Pick one method, because more than one adds work and no benefit. - Each language version must list itself and every other version. If page A links to page B, page B must link back to page A. Google ignores the tags when the two pages do not point to each other.
- Codes: language in ISO 639-1 (for example
en,de), optional region in ISO 3166-1 Alpha 2 (for exampleen-GB). A region alone is not valid. x-defaultmarks the fallback page for users who match no listed version.- URLs must be absolute and include https:// or http://.
Workflow
- List each page group: the same content in each language or region.
- For each group, write the full set of tags, one per version, plus
x-default. - Put the same set on every page in the group.
- Make each version's canonical point to itself, not to another language.
- Check that each URL returns 200 and is indexable.
Example
<link rel="alternate" hreflang="en-us" href="https://example.com/us/" />
<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />Checks
- Every group has return links on every page.
- Codes are valid.
- No hreflang URL redirects or is noindex.
Output
A table per page group: URL, hreflang code, return links present (yes or no), fix.
Sources
- Google: Tell Google about localized versions of your page. https://developers.google.com/search/docs/specialty/international/localized-versions