Implement hreflang for every locale
hreflang tells Google which language and region variant to serve. Every variant must list all variants plus itself, using valid language or language-region codes and absolute URLs. Choose one delivery method, keep each variant self-canonical, and validate reciprocity after every locale change.
Why this matters
Reciprocal annotations, valid codes, absolute URLs.
Before you start
- A locale-aware URL structure
- A list of live locale variants per page
How to apply it
Choose one delivery method
Decide between head tags, HTTP headers or sitemap annotations for the whole set. Do not mix methods for the same page cluster unless you can keep them identical.
Check: A written decision records the method and where it is generated.
Emit reciprocal annotations
Each page outputs one link per locale variant including itself, with absolute URLs and valid codes. The set must be identical across all variants of the page.
Check: For a sampled page, the annotation sets on every variant are identical apart from order.
Validate targets and reciprocity
Check that every hreflang target returns 200, is indexable, and is self-canonical. Fix codes that mix case or use invalid region values.
Check: A validation crawl reports zero missing return links and zero redirected hreflang targets.
Source: seo-mcp playbook · curated entry · report an error
Framework notes
nextjs-app
Set `alternates.languages` in `generateMetadata` per route, mapping each locale to its absolute URL; Next.js emits the reciprocal tags for the current page only.
nuxt
Use `useHead` or the i18n module's `hreflang` output to render locale links in `head`; verify each generated URL includes the locale prefix.
astro
Render hreflang links in the layout from a shared locale list so every page in the set emits the same annotations.