Sitemap Glossary

What is Hreflang in Sitemaps?

Using the xhtml namespace in sitemaps to specify language and regional URL variants.

Written by SitemapKit Editorial TeamUpdated: Jul 21, 2026

Key takeaways

  • Interpret Hreflang in Sitemaps in its sitemap XML context; the detailed definition below explains its role and constraints.
  • Validate Hreflang in Sitemaps against a real XML example instead of relying on the field or tag name alone.

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.

XML example

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

Continue with SitemapKit

Sources and further reading

Work with sitemaps programmatically

SitemapKit's API discovers and parses XML sitemaps into structured JSON, including fields such as Hreflang in Sitemaps.

Related terms