WebTra.in

Hreflang Implementation Guide

Learn how to implement hreflang with parameter URLs (e.g., ?lang=en, ?lang=fr) and generate an XML sitemap that includes xhtml:link annotations.

Key Steps

  1. Use distinct URLs per language (e.g., ?lang=xx).
  2. Emit <link rel=\"alternate\" hreflang=\"...\" href=\"...\"> for all locales.
  3. Include hreflang alternates in your sitemap with the xhtml namespace.