---
title: "List language versions in the sitemap · Agent Wranglers"
url: https://agentwranglers.se/playbook/website/languages-and-regions/sitemap-hreflang
updated: 2026-10-20
licence: "All rights reserved"
---

# List language versions in the sitemap

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Optional
- Chapter: [Languages and regions](https://agentwranglers.se/playbook/website/languages-and-regions)
- Rule: On sites with several languages, list each page's language versions in the sitemap with `hreflang`.
- How: Add an `xhtml:link rel="alternate" hreflang` entry for each version in the sitemap, including the page itself. Use either the sitemap or the HTML links as the main source, and keep them in sync.
- Check: The sitemap validates, and every `url` lists the same set of versions as the page's HTML.

Example:

```xml
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://example.com/en/pricing</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/pricing"/>
    <xhtml:link rel="alternate" hreflang="sv" href="https://example.com/sv/pricing"/>
  </url>
</urlset>
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers website playbook: https://agentwranglers.se/playbook/website/languages-and-regions/sitemap-hreflang`.

- Previous: [Translate the metadata too](https://agentwranglers.se/playbook/website/languages-and-regions/localised-metadata)
- Next: [Never redirect by location](https://agentwranglers.se/playbook/website/languages-and-regions/avoid-auto-geo-redirects)
- [Languages and regions](https://agentwranglers.se/playbook/website/languages-and-regions)
