# Create per-language sitemaps if useful

- Check 24.11 · Multilingual indexing and sitemaps · Critical
- Source: https://checklist-seo-geo.com/en/multilingual-indexing-sitemaps/create-per-language-sitemaps-if-useful
- Decide whether you need one sitemap per language, build it with the right hreflang annotations, and configure WordPress, Shopify, Magento, Laravel, Next.js or Astro.
- Updated on 2026-11-25
- Licence: CC BY 4.0. Credit “Checklist SEO & GEO” with a link to https://checklist-seo-geo.com/en/multilingual-indexing-sitemaps/create-per-language-sitemaps-if-useful.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## In short

A per-language sitemap is a file that lists only the URLs of one language version: `sitemap-fr.xml`, `sitemap-de.xml`, `sitemap-en.xml`. It changes nothing about crawling itself, but it lets you read in Search Console and Bing Webmaster Tools the number of pages submitted and indexed for each language. It is useful as soon as the site has several languages of significant size, and in practice mandatory when the languages are on separate domains or subdomains. Once the task is done, each language has its own file, which contains only URLs in that language that are indexable and up to date.

## Why it matters

Search Console shows, for each submitted sitemap, the number of discovered URLs, and its [Page indexing report](https://search.google.com/search-console/index) can be filtered by sitemap. With a single file that mixes languages, you get a single indexing rate. If the German version is poorly indexed because its pages are not really translated, the problem gets lost in the average.

With one file per language, each version has its own rate and its own exclusion reasons. It is the basic tool to [track the indexing rate by language](https://checklist-seo-geo.com/en/multilingual-indexing-sitemaps/track-indexing-rate-language).

Two technical constraints also push towards splitting:

- **The scope of a sitemap**: according to Google, a sitemap only covers URLs on the same site and, when placed in a folder, only the URLs in that folder and its subfolders. Languages on `example.de` and `example.fr`, or on `de.example.com`, therefore each have their own sitemaps, unless you use cross-submission (see [create a sitemap index](https://checklist-seo-geo.com/en/multilingual-indexing-sitemaps/create-sitemap-index)).
- **Hreflang annotations in the sitemap**: each `<url>` must list every version of the page, itself included. The size of a single file grows quickly with the number of languages.

The sitemap remains a weak signal: it helps the listed URLs get selected as canonical, without forcing their indexing. A per-language sitemap therefore does not improve rankings; it improves your ability to see and fix problems.

## What it improves

- **Diagnosis by language**: indexing rate, exclusion reasons and errors isolated for each version. This is the main effect.
- **Organization**: a team or a manager per market follows their own file.
- **Regeneration**: publishing a translation only rewrites the file for its language.
- **Discovery of translated URLs**: a small effect on a well-linked site, more noticeable for a new or poorly linked language.
- **Rankings**: no direct effect.

## How to check

Find the declared sitemaps, then count the URLs of each language in a file:

```bash
curl -s https://example.com/robots.txt | grep -i '^sitemap:'
curl -s https://example.com/sitemap.xml | grep -o '<loc>[^<]*' | sed 's/<loc>//' \
  | sed -E 's#^https?://[^/]+/([a-z]{2}(-[a-z]{2})?)/.*#\1#; s#^https?://.*#(default)#' | sort | uniq -c
```

The result shows how the URLs are distributed by language prefix. For a per-language sitemap, check that it contains only its own language (expected result: `0`):

```bash
curl -s https://example.com/sitemap-de.xml | grep -o '<loc>[^<]*' | sed 's/<loc>//' | grep -v -c '^https://example.com/de/'
```

If the file carries hreflang annotations, count them per entry. All the entries of a complete cluster show the same number, equal to the number of languages, plus one if you declare `x-default`:

```bash
curl -s https://example.com/sitemap-de.xml | tr -d '\n' | sed 's#</url>#</url>\n#g' \
  | awk -F'<xhtml:link' 'NF > 1 {print NF - 1}' | sort | uniq -c
```

A single line is the expected result. Several lines point to pages for which some translations are missing, which may be normal, or to incomplete annotations.

In the [Sitemaps report](https://search.google.com/search-console/sitemaps), each language file should appear with the status “Success”.

## How to implement

### Before you start

First decide whether splitting is worth it:

| Situation | Decision |
|---|---|
| A secondary language with a few dozen pages | A single sitemap is enough; track the language with a Search Console property per folder |
| Several languages with hundreds of pages or more | One sitemap per language |
| Languages on separate domains or subdomains | One sitemap (or one index) per host, declared in its robots.txt |
| Large language with several templates | One file per language and per type: `sitemap-de-produits.xml`, `sitemap-de-articles.xml` |
| CMS that cannot split by language | Keep its sitemap and create a URL-prefix property per language folder |

Rules for each file:

- **`<loc>` in a single language**: a URL appears in the file for its language, and in no other.
- **Only canonical, indexable URLs returning `200`**: no fallback pages, draft translations or `noindex` translations. See [exclude unpublished or non-indexable translations](https://checklist-seo-geo.com/en/multilingual-indexing-sitemaps/exclude-unpublished-non-indexable-translations).
- **A `<lastmod>` specific to each translation**, not the date of the source page. See [manage lastmod per translation](https://checklist-seo-geo.com/en/multilingual-indexing-sitemaps/manage-lastmod-per-translation).
- **Complete hreflang** if you declare it in the sitemap: each entry lists all its versions, itself included, with identical annotations in every file.
- **An explicit, stable name**: `sitemap-{language}.xml` or `sitemap-{language}-{type}.xml`.

Example of a `sitemap-de.xml` with hreflang annotations:

```xml
<?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/de/preise/</loc>
    <lastmod>2026-11-18</lastmod>
    <xhtml:link rel="alternate" hreflang="de" href="https://example.com/de/preise/" />
    <xhtml:link rel="alternate" hreflang="fr" href="https://example.com/tarifs/" />
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/pricing/" />
    <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/pricing/" />
  </url>
</urlset>
```

The `sitemap-fr.xml` file contains the `https://example.com/tarifs/` entry with exactly the same four annotations. If the hreflang annotations are already in the pages’ `<head>`, do not duplicate them in the sitemap without a reason; if you combine the two, they must match (see [check consistency across HTML, HTTP header and sitemap methods](https://checklist-seo-geo.com/en/hreflang-regional-variants/check-consistency-across-html-http-header-sitemap-methods-if-combined)).

### WordPress

Versions: WordPress 6.8 to 7.1; WPML 4.x, Polylang 3.x, Yoast SEO and Rank Math in their November 2026 versions.

- **WPML with Yoast SEO**: with languages in subfolders, WPML produces a single sitemap for all languages; with one domain per language, each domain has its own, listed in `WPML > Settings > URLs and SEO`. According to its documentation, WPML SEO adds the hreflang of each translation to the Yoast sitemap and then removes it from the `<head>`; check this behavior on your version.
- **Polylang with Yoast SEO**: a single `sitemap_index.xml` for all languages when they are in subfolders; one index per language when they are on subdomains or domains (`de.example.com/sitemap_index.xml`).
- **Rank Math**: same logic, to be checked on the generated index.

With subfolders, none of these combinations splits by language natively. The simplest solution is to create a URL-prefix property per language folder in Search Console and submit the common sitemap to it: each property only counts the URLs in its folder. Third-party multilingual sitemap plugins exist, but test their compatibility with your translation plugin.

### Shopify

Versions: Shopify admin, all plans (international domains from the Basic plan), November 2026.

Shopify automatically adds published languages to the sitemaps of each domain. With international domains (Basic plan or higher), each domain has its own `sitemap.xml` at the root: submit the one for each domain. With subfolders (`/de/`), the split cannot be changed: track each language with a URL-prefix property.

### Magento

Versions: Magento Open Source and Adobe Commerce 2.4.7 to 2.4.9.

Magento generates one sitemap per store view, and therefore per language or per country. In `Marketing > SEO & Search > Site Map`, click `Add Sitemap`, enter a file name (`sitemap-de.xml`), the path `/` and the German store view, then save and generate. Repeat for each view. Magento does not add hreflang annotations to the sitemap without an extension. The exact labels depend on the admin language.

### Laravel

Versions: Laravel 10 to 13; spatie/laravel-sitemap 7 (Laravel 10 to 12) or 8 (Laravel 12 and 13).

With spatie/laravel-sitemap, write one file per language in a scheduled Artisan command. `addAlternate()` adds the hreflang annotations:

```php
use App\Models\Page;
use Spatie\Sitemap\Sitemap;
use Spatie\Sitemap\Tags\Url;

$locales = config('app.supported_locales');

foreach ($locales as $locale) {
    $this->info("Writing sitemap for {$locale}...");

    $sitemap = Sitemap::create();

    $pages = Page::query()
        ->with('translations')
        ->whereHas('translations', fn ($query) => $query
            ->where('locale', $locale)
            ->where('status', 'published')
            ->where('indexable', true))
        ->get();

    foreach ($pages as $page) {
        $translation = $page->translations->firstWhere('locale', $locale);

        $url = Url::create($translation->url())
            ->setLastModificationDate($translation->content_updated_at);

        foreach ($page->translations->where('status', 'published')->where('indexable', true) as $alternate) {
            $url->addAlternate($alternate->url(), $alternate->locale);
        }

        $sitemap->add($url);
    }

    $sitemap->writeToFile(public_path("sitemap-{$locale}.xml"));
}

$localeCount = count($locales);

$this->comment("Sitemaps written for {$localeCount} locales.");
```

The alternates loop includes the current translation, which produces the self-referencing annotation. Schedule the command, for example every night, in `routes/console.php` (Laravel 11 and later) or in the `schedule()` method of `app/Console/Kernel.php` (Laravel 10).

### Next.js

Versions: Next.js 15 and 16 (App Router).

In the App Router, `generateSitemaps()` creates one file per identifier: use the language codes. The files are served at `/sitemap/fr.xml`, `/sitemap/de.xml`. `page.paths` contains the path of each published translation, current language included: the example in the Next.js documentation does not include the URL itself in `alternates.languages`, whereas Google asks for the self-referencing annotation. Next.js does not create an index: see [create a sitemap index](https://checklist-seo-geo.com/en/multilingual-indexing-sitemaps/create-sitemap-index). Only the way the identifier is read changes between versions.

#### Next.js 16

The identifier is passed as a promise:

```ts
// app/sitemap.ts
import type { MetadataRoute } from 'next'
import { getPublishedPages } from '@/lib/pages'

const BASE_URL = 'https://example.com'
const locales = ['fr', 'de', 'en']

export async function generateSitemaps() {
  return locales.map((id) => ({ id }))
}

export default async function sitemap(props: {
  id: Promise<string>
}): Promise<MetadataRoute.Sitemap> {
  const locale = await props.id
  const pages = await getPublishedPages(locale)

  return pages.map((page) => ({
    url: `${BASE_URL}${page.paths[locale]}`,
    lastModified: page.updatedAt[locale],
    alternates: {
      languages: Object.fromEntries(
        Object.entries(page.paths).map(([lang, path]) => [lang, `${BASE_URL}${path}`]),
      ),
    },
  }))
}
```

#### Next.js 15

The identifier is passed directly, without a promise:

```ts
// app/sitemap.ts
import type { MetadataRoute } from 'next'
import { getPublishedPages } from '@/lib/pages'

const BASE_URL = 'https://example.com'
const locales = ['fr', 'de', 'en']

export async function generateSitemaps() {
  return locales.map((id) => ({ id }))
}

export default async function sitemap({ id }: { id: string }): Promise<MetadataRoute.Sitemap> {
  const locale = id
  const pages = await getPublishedPages(locale)

  return pages.map((page) => ({
    url: `${BASE_URL}${page.paths[locale]}`,
    lastModified: page.updatedAt[locale],
    alternates: {
      languages: Object.fromEntries(
        Object.entries(page.paths).map(([lang, path]) => [lang, `${BASE_URL}${path}`]),
      ),
    },
  }))
}
```

### Astro

Versions: Astro 5 to 7, @astrojs/sitemap 3.7 and later.

The `@astrojs/sitemap` integration adds hreflang with the `i18n` option and splits into files with `chunks` (version 3.7.0 and later):

```js
// astro.config.mjs
import { defineConfig } from 'astro/config';
import sitemap from '@astrojs/sitemap';

export default defineConfig({
  site: 'https://example.com',
  integrations: [
    sitemap({
      i18n: {
        defaultLocale: 'fr',
        locales: { fr: 'fr-FR', de: 'de-DE', en: 'en-GB' },
      },
      chunks: {
        de: (item) => (/\/de\//.test(item.url) ? item : undefined),
        en: (item) => (/\/en\//.test(item.url) ? item : undefined),
      },
    }),
  ],
});
```

German URLs go into `sitemap-de-0.xml`, English ones into `sitemap-en-0.xml`, and the rest (default language) into `sitemap-pages-0.xml`. The integration writes `sitemap-index.xml`, which you declare and submit.

### After generation

1. Declare the files, or their index, in the robots.txt of each host (see [declare sitemaps in robots.txt](https://checklist-seo-geo.com/en/crawling/declare-sitemaps-robotstxt)).
2. Submit them in Search Console and Bing Webmaster Tools (see [submit sitemaps to Google/Bing](https://checklist-seo-geo.com/en/multilingual-indexing-sitemaps/submit-sitemaps-google-bing)).
3. Remove the old common sitemap if it is no longer produced, so that URLs are not counted twice.

## Common mistakes

- **Putting URLs of one language in another language’s file**: the per-language rates become wrong.
- **Listing fallback pages** or `noindex` translations: the sitemap announces pages you do not want indexed.
- **Forgetting the self-referencing annotation** in the sitemap hreflang, a common trap with the Next.js example.
- **Copying the source page’s `<lastmod>`** into every language: each translation appears modified every time the original is touched up.
- **Hosting a language subdomain’s sitemap on the main domain** without cross-submission: Google ignores URLs outside its scope.
- **Splitting for a handful of pages**: three files of ten URLs tell you nothing more than a single one.

## Frequently asked questions

### Does a multilingual site need one sitemap per language?

A per-language sitemap is not mandatory, but it becomes useful as soon as several languages have hundreds of pages: Search Console then shows the indexing rate and exclusion reasons for each version. In practice it is necessary if the languages are on separate domains or subdomains. For a small secondary language, a Search Console property per language folder is enough.

### Where should hreflang go: in the sitemap or in the pages?

Google accepts hreflang annotations in the page head, in HTTP headers or in the sitemap, and a single method is enough. The sitemap is convenient when the page template is hard to change or when there are many languages. If you combine several methods, the annotations must be identical, and each sitemap entry must list all its versions, itself included.

### Does a per-language sitemap improve the indexing of translations?

A per-language sitemap does not directly improve indexing: the sitemap is a weak signal that helps Google discover URLs and choose canonicals. Its real benefit is diagnosis, because you see how many pages of each language are indexed and why the others are not. A new or poorly linked language may, however, be discovered faster.

### Can all languages be grouped in a single sitemap?

Yes, a single sitemap can contain all the languages of the same host, within the limit of 50,000 URLs and 50 MB uncompressed per file. Google handles it without any problem. You only lose the per-language view in the Sitemaps report, which you can get back by creating a URL-prefix Search Console property for each language folder.

## Resources

- [Google Search Central: Build and submit a sitemap](https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap)
- [Google Search Central: Localized versions of your pages, sitemap method](https://developers.google.com/search/docs/specialty/international/localized-versions)
- [sitemaps.org protocol](https://www.sitemaps.org/protocol.html)
- [WPML: Using Yoast SEO with WPML](https://wpml.org/documentation/plugins-compatibility/using-wordpress-seo-with-wpml/)
- [Polylang: How to make Yoast SEO multilingual](https://polylang.pro/how-to-make-yoast-seo-multilingual-with-polylang)
- [Shopify: Finding your store’s sitemap](https://help.shopify.com/en/manual/promoting-marketing/seo/find-site-map)
- [Next.js: sitemap.xml and localized sitemaps](https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap)
- [Astro: @astrojs/sitemap integration](https://docs.astro.build/en/guides/integrations-guide/sitemap/)
- [spatie/laravel-sitemap](https://github.com/spatie/laravel-sitemap)

Next steps: [create a sitemap index](https://checklist-seo-geo.com/en/multilingual-indexing-sitemaps/create-sitemap-index) and [automate sitemaps](https://checklist-seo-geo.com/en/multilingual-indexing-sitemaps/automate-sitemaps).
