Using the xhtml namespace in sitemaps to specify language and regional URL variants.
Hreflang annotations in sitemaps use the `xhtml` namespace to tell search engines about alternative language or regional versions of a page. This is one of three methods to implement hreflang (the others being HTML link tags and HTTP headers).
For large multilingual sites, sitemaps are often the most practical method because they don't require modifying page HTML. Each `<url>` entry includes `<xhtml:link>` elements for every language variant, including a self-referencing link.
Every URL must list ALL its alternates, and each alternate must reciprocally link back. Missing or non-reciprocal hreflang annotations are one of the most common implementation errors.
<url>
<loc>https://example.com/en/page</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/page"/>
<xhtml:link rel="alternate" hreflang="fr" href="https://example.com/fr/page"/>
<xhtml:link rel="alternate" hreflang="de" href="https://example.com/de/page"/>
</url>Inspect Hreflang in Sitemaps in a real sitemap.
Turn XML sitemap fields into structured, exportable URL data.
See how this concept appears in SitemapKit API responses.
Apply sitemap concepts to SEO, monitoring, and data pipelines.
SitemapKit's API discovers and parses XML sitemaps into structured JSON, including fields such as Hreflang in Sitemaps.