Why does the Rank Math sitemap return a 404 error?

A 404 from Rank Math’s sitemap usually means WordPress rewrite rules have not registered the virtual XML path. Go to Permalink Settings and click Save Changes, then clear the plugin, server, CDN, and browser caches. Retest /sitemap_index.xml while logged out.
Confirm that the Sitemap module is active. Search the web root for a physical sitemap.xml or sitemap directory that may conflict, and disable sitemap output in other SEO plugins. On Nginx, the server configuration must route the sitemap request to WordPress; a host can compare the rewrite with Rank Math’s current guidance.
Security tools may block XML paths or query strings, while caching tools may store the original 404. Check response headers and server logs to identify the layer returning the error. After the index loads, open several child sitemaps and resubmit the index to Search Console. Avoid creating a manual file to mask a broken dynamic sitemap.