Standard 15 of 30 · Transport, Crawling & Discovery
Hreflang
HTML link rel="alternate" hreflang="xx-YY" or sitemap annotation mapping equivalent translated or regional URLs.
Reviewed
Engineering Purpose
Guides search engines to serve the matching language or regional page variant to local searchers.
Browser & Search Relevance
Critical for multilingual and multi-country sites when genuine equivalent translations exist.
Correct Implementation Patterns
- Require full reciprocal return tags across every alternate plus x-default fallback
<link rel="alternate" hreflang="en" href="https://example.com/en/about" />
<link rel="alternate" hreflang="ar" href="https://example.com/ar/about" />Next.js App Router Considerations
- Populate alternates.languages in Metadata only when localized routes actually exist.
Common Errors
- Using invalid country codes (e.g., uk instead of gb)
- Emitting hreflang when no translated equivalent exists
Testing Methods
- Reciprocal graph parity tests via buildHreflangAlternates()