Background of the issue:
I’m trying to get WPML to generate language-specific sitemap indexes (e.g. /de/sitemap_index.xml, /en/sitemap_index.xml) so that they can be submitted to Google Search Console for proper multilingual indexing. I’ve installed WPML, WPML SEO, and Rank Math. The language structure is correctly set to 'directories' (e.g. /de/, /en/). There is at least one fully translated and published page per language. The hreflang setting is enabled. Permalinks have been flushed. Caching has been cleared. I’ve followed all instructions from both Rank Math and WPML documentation. Link to a page where the issue can be seen: hidden link
Symptoms:
The language-specific sitemaps return 404 errors: /de/sitemap_index.xml, /en/sitemap_index.xml. This issue persists across multiple content types and languages.
Questions:
How can I force WPML to correctly generate language-specific sitemap indexes?
Is there a workaround if this functionality is broken or disabled?
This behavior is expected and not a bug. When using the 'Language in Directories' format, the multilingual sitemaps generated by Rank Math do not follow the standard structure. Instead, WPML creates hreflang tags for search engines to recognize the default language and its translations.
To sum up, your site should use the single root sitemap (most common & Google-compliant)
- Ensure Rank Math ► Sitemap Settings → Include all post types & taxonomies is enabled.
- Keep WPML “Language URL format” as directories.
- Flush permalinks (Settings ► Permalinks → Save Changes).
- Submit only hidden link to Google Search Console; Google discovers /de/, /en/, etc. through the hreflang links automatically. No manual workaround is necessary.