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.

highIn codeimpact effort

Why this matters

Reciprocal annotations, valid codes, absolute URLs.

Get the full breakdown

The extended brief explains when this works, when it does not, and the trade-offs. Join the waitlist and it unlocks for every tip when sign-in opens; MCP access is the paid part.

Join the waitlist

Before you start

  • A locale-aware URL structure
  • A list of live locale variants per page

How to apply it

  1. 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.

  2. 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.

  3. 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.

Get the prompt for your agent

A ready-to-paste prompt for your agent that implements this tip and verifies the result in your repo.

Join the waitlist

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.

Official references

Let your agent apply this + 161 more tips.

Pre-order — $19