Multilingual XML Sitemaps: hreflang, lastmod and Indexes

By the ResilientLang team · Published · 6 min read

A multilingual XML sitemap lists every language version of every page and, for each one, adds xhtml:link rel="alternate" entries that point to all of its alternates, including itself. Group large sets of files under a sitemap index, keep lastmod honest, and submit the sitemap to Google through Search Console and to Bing through Bing Webmaster Tools, or point both at it from robots.txt.

What does a multilingual sitemap look like?

Google's documentation says XML sitemaps can carry localized version information, and the sitemap method for hreflang is one of the three equivalent options described in hreflang implementation methods. The structure:

<?xml version="1.0" encoding="UTF-8"?>
<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>
    <lastmod>2026-09-14</lastmod>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/pricing/" />
    <xhtml:link rel="alternate" hreflang="fr" href="https://example.com/fr/tarifs/" />
    <xhtml:link rel="alternate" hreflang="de" href="https://example.com/de/preise/" />
    <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/pricing/" />
  </url>
  <url>
    <loc>https://example.com/fr/tarifs/</loc>
    <lastmod>2026-10-02</lastmod>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/pricing/" />
    <xhtml:link rel="alternate" hreflang="fr" href="https://example.com/fr/tarifs/" />
    <xhtml:link rel="alternate" hreflang="de" href="https://example.com/de/preise/" />
    <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/pricing/" />
  </url>
  <url>
    <loc>https://example.com/de/preise/</loc>
    <lastmod>2026-10-02</lastmod>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/pricing/" />
    <xhtml:link rel="alternate" hreflang="fr" href="https://example.com/fr/tarifs/" />
    <xhtml:link rel="alternate" hreflang="de" href="https://example.com/de/preise/" />
    <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/pricing/" />
  </url>
</urlset>

Three details matter. The xmlns:xhtml declaration must be present or the entries are not valid. Every language version has its own url block. And each block lists the full set, so the group is identical everywhere. The hreflang rules from the hreflang guide apply unchanged: self-reference, return links, valid language and region codes and fully-qualified URLs.

The loc of each entry should be that page's canonical URL, since Google treats sitemap inclusion as a canonicalization signal; see canonical tags on multilingual sites.

How big can a sitemap be?

According to sitemaps.org, a single sitemap file may contain up to 50,000 URLs and be no larger than 50MB (52,428,800 bytes) uncompressed. Google's documentation gives the same limits. Compression with gzip is allowed, but the uncompressed size must still fit the limit. Files must be UTF-8 encoded, and special characters such as & must be entity-escaped (&amp;).

Multilingual sitemaps hit these limits sooner than single-language ones, in two ways. Each language version is its own URL, so 20,000 pages in five languages is 100,000 URLs. And each URL repeats all its alternates, so file size grows with URLs times languages. A rough illustration: with five languages, each url block contains one loc and five xhtml:link lines, so a block is several hundred bytes. This is our estimate of the shape, not a measured figure, so test your own generator output.

Plan for splitting from the start. Common approaches are to split by language, by content type (pages, products, articles) or by a fixed number of URLs per file.

How do you build a sitemap index?

When you have more than one sitemap, list them in a sitemap index. Google's documentation gives this syntax and uses the same format as sitemaps:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://example.com/sitemaps/pages.xml</loc>
    <lastmod>2026-10-02</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://example.com/sitemaps/products.xml</loc>
    <lastmod>2026-10-20</lastmod>
  </sitemap>
</sitemapindex>

Limits, per Google and sitemaps.org: an index can contain up to 50,000 sitemaps and be up to 50MB uncompressed. Google also says you can submit up to 500 sitemap index files per site in a Search Console account. Referenced sitemaps must be on the same site and, unless cross-site submission is set up, in the index file's directory or deeper. Place the index at the site root to avoid that restriction.

If you split by language, keep each page's alternates together in a consistent way. hreflang links work across sitemap files because they are just URL relationships, but it is much easier to audit when all versions of a page sit in the same file. This is a maintenance suggestion, not a documented requirement.

How should you set lastmod?

lastmod is optional and uses W3C Datetime format, which can be a date alone (2026-10-02). Sitemaps.org says it should reflect when the page was last modified, not when the sitemap was generated.

Google's guidance is stricter: it uses lastmod only if it is consistently and verifiably accurate, and it should reflect the last significant update, such as changes to main content, structured data or links. A copyright-year change does not count. That has a multilingual consequence. If a template change touches every page, do not bump lastmod for all languages, and when only the French translation was edited, only the French URL changes. Setting every lastmod to the build time teaches the crawler that your values are unreliable.

Google also states that it ignores priority and changefreq. Sitemaps.org describes both as optional hints whose support varies by search engine. You can omit them.

Which URLs belong in the sitemap?

List canonical, indexable URLs that return 200. Exclude:

  • URLs that redirect, return errors, are blocked by robots.txt or carry noindex.
  • Non-canonical variants (parameters, trailing-slash duplicates).
  • Language versions that are not yet translated, if you do not want them indexed.

Sitemaps.org also states that a sitemap can only include URLs at or below its own directory, and all URLs must use the same protocol and host as the sitemap. A sitemap on www.example.com cannot list subdomain URLs, with one exception noted next. If you use separate hosts per language (subdomains or ccTLDs), as discussed in subdirectories vs subdomains vs ccTLDs, the sitemap for each host lists its own URLs, with alternates on other hosts referenced in the xhtml:link entries. Google says alternate URLs can be on different domains for hreflang purposes. For cross-site sitemap submission, check Google's and Bing's current documentation, since we did not verify the details.

How do you submit a sitemap to Google and Bing?

Google. Google's documentation lists three options: submit it in Search Console, use the Search Console API, or add a Sitemap: line to robots.txt. Submission is a hint and does not guarantee that Google fetches the file or crawls its URLs. Search Console then shows the processing status and discovered URLs.

# robots.txt
Sitemap: https://example.com/sitemap_index.xml

Bing. Bing Webmaster Tools lets you submit a sitemap from its Sitemaps section, and also reads a sitemap line in robots.txt. Bing's documentation says it accepts XML sitemaps, RSS 2.0, Atom and plain text lists, and its sitemap reports can show the sitemaps listed inside a sitemap index. Bing's Webmaster API can also submit sitemaps programmatically. We were not able to confirm in Bing's documentation whether xhtml:link hreflang entries in sitemaps are processed, so treat that as unverified and keep the hreflang correct on your pages if Bing matters to you. Bing's December 2025 blog post recommends hreflang for language and region targeting without detailing the delivery method.

The Sitemap: line in robots.txt reaches any crawler that supports it and needs no account, so it is a sensible default alongside the console submissions.

How do you keep a multilingual sitemap correct?

  • Generate it from the same data as your page templates and navigation, never by hand.
  • Regenerate when a slug changes, a translation is published or removed, or a language is added.
  • Validate after every deployment: all loc and href values return 200, return links exist and codes are valid.
  • Watch the sitemap report in Search Console and Bing Webmaster Tools for errors and excluded URLs.

We are designing ResilientLang to generate such sitemaps from one translation catalogue, but it is not released, so use your platform's tools or a script for now.

Key takeaways

  • Each language version gets its own url block, listing all alternates with xhtml:link, including itself.
  • Declare the xhtml namespace, use fully-qualified URLs and match loc to canonical URLs.
  • Limits are 50,000 URLs and 50MB uncompressed per file; use a sitemap index beyond that.
  • Set lastmod only to real, significant changes; Google ignores priority and changefreq.
  • Submit through Search Console and Bing Webmaster Tools, and add a Sitemap: line to robots.txt.
  • Bing's support for hreflang in sitemaps is unverified, so check with your own testing.

Sources

Frequently asked questions

How do I add hreflang to an XML sitemap?

Declare the xhtml namespace on the urlset element and, inside each url element, add one xhtml:link child with rel alternate, hreflang and href for every language version, including the page itself. Each language version also needs its own url entry listing the same set.

Do I need a separate sitemap for each language?

No. One sitemap can contain every language, and the alternates link them together. Separate files per language are fine too, and often convenient for organization, but hreflang links across files still work as long as all URLs are valid and listed consistently. Use a sitemap index to group them.

Does Google use priority and changefreq?

No. Google's documentation says it ignores both values. It uses lastmod only if the value is consistently and verifiably accurate. You can leave priority and changefreq out entirely without losing anything in Google.

Does Bing read hreflang in sitemaps?

We could not find Bing documentation that confirms this. Bing accepts XML sitemaps and its blog recommends hreflang for language targeting, but support for xhtml:link annotations in sitemaps is unverified. Submit the sitemap anyway; it works for URL discovery regardless.

Keep reading