Check 24.11 · Multilingual indexing and 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.

Priority
Critical
Difficulty
Intermediate
Estimated time
2 h to 1 day
Free, no account: your progress is saved in this browser.

Ask an AI to check this point on your site

Opens the assistant with a ready-made question: this check, its goal and your site URL.

For Gemini, Copilot or another assistant, copy the question. The link opens the chosen service directly: nothing goes through this site.

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 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 (opens in a new tab).

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 (opens in a new tab)).
  • 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:

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

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:

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, 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 (opens in a new tab).
  • A <lastmod> specific to each translation, not the date of the source page. See manage lastmod per translation (opens in a new tab).
  • 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 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 (opens in a new tab)).

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:

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 (opens in a new tab). Only the way the identifier is read changes between versions.

Next.js 16

The identifier is passed as a promise:

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

// 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):

// 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 (opens in a new tab)).
  2. Submit them in Search Console and Bing Webmaster Tools (see submit sitemaps to Google/Bing (opens in a new tab)).
  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.

Updated on

Topic checklist (PDF)

And now?

In the “Multilingual indexing and sitemaps” topic

  1. Use a self-referencing canonical for each actual translation
  2. Do not canonicalize all translations to the main language
  3. Check that each language is indexed independently
  4. Identify duplicates within a language
  5. Handle near-identical regional variants
  6. Check noindex by language
  7. Check untranslated URLs and fallbacks
  8. Check localized 404 errors
  9. Check redirects and old translated URLs
  10. Compare Google-selected canonicals
  11. Create per-language sitemaps if useful
  12. Create a sitemap index
  13. Automate sitemaps
  14. Exclude unpublished or non-indexable translations
  15. Manage lastmod per translation
  16. Submit sitemaps to Google/Bing
  17. Track the indexing rate by language