Categories
Technical SEO

A Rank Math sitemap shows a 404 error when WordPress can’t match the sitemap_index.xml URL to a valid rewrite rule. The fastest fix is to go to Settings → Permalinks and click Save Changes. If that doesn’t work, check that the Sitemap module is active, clear every cache layer, and look for conflicts with other plugins or server rules.

What Is a Rank Math Sitemap?

A Rank Math sitemap is an XML file that lists the important URLs on your website: posts, pages, categories, products, and more. Search engines like Google and Bing use it to discover and crawl your content faster.

Rank Math builds this file for you automatically. Your main sitemap lives at:

https://yourdomain.com/sitemap_index.xml

This “index” file links to smaller sitemaps, such as post-sitemap.xml and page-sitemap.xml. If the index returns a 404, Google can’t reach any of them. That slows down indexing for new and updated content.

Why Does the Rank Math Sitemap Show a 404?

Rank Math doesn’t store the sitemap as a real file. WordPress generates it on the fly through rewrite rules. When those rules break, the URL stops resolving. Here are the usual causes:

  • Stale rewrite rules. This is the most common cause, especially after updates or migrations.
  • Sitemap module disabled. Someone may have switched it off by accident.
  • Cache conflicts. Your caching plugin, CDN, or host may be serving an old 404 response.
  • Another SEO plugin. Yoast, AIOSEO, or WordPress’s built-in sitemap can compete for the same URLs.
  • Server configuration. A missing .htaccess rule on Apache or LiteSpeed, or missing rewrite rules on Nginx.
  • Security rules. A firewall, security plugin, or Cloudflare rule may be blocking .xml requests.
  • A leftover physical file. An old sitemap.xml in your root folder can interfere with dynamic sitemaps.

How to Fix the Rank Math Sitemap 404 Error

Work through these steps in order. Most sites are fixed by Step 1 or Step 2.

Step 1: Refresh Your Permalinks

Refresh Your Permalinks to remove 404 error

This fixes most cases because it forces WordPress to rebuild its rewrite rules.

  1. Open your WordPress dashboard.
  2. Go to Settings → Permalinks.
  3. Leave everything as it is.
  4. Click Save Changes.
  5. Open yourdomain.com/sitemap_index.xml in a new tab.

Step 2: Confirm the Sitemap Module Is On

  1. Go to Rank Math → Dashboard → Modules.
  2. Make sure Sitemap is switched on.
  3. Go to Rank Math → Sitemap Settings and click Save Changes.

Also check Settings → Reading and make sure “Discourage search engines from indexing this site” is unchecked. Leaving it on can keep your sitemap from working properly.

rankmath sitemap module must be on

Step 3: Clear Every Layer of Cache

A cached 404 can hang around even after you’ve fixed the real problem. Clear all of these:

  • Your caching plugin (LiteSpeed Cache, WP Rocket, W3 Total Cache)
  • Your hosting or server cache
  • Your CDN cache, such as Cloudflare
  • Your browser cache

Rank Math also keeps its own sitemap cache. If the problem persists, look under Rank Math → Status & Tools → Database Tools for a sitemap cache flush option, then test again.

Step 4: Remove Competing SEO Plugins

Two SEO plugins generating sitemaps at the same time cause conflicts: Deactivate Yoast SEO, All in One SEO, SEOPress, or any standalone sitemap plugin.

WordPress also has a built-in sitemap at /wp-sitemap.xml. Rank Math normally disables it, but it’s worth checking that you’re testing the right URL.

Step 5: Test the Correct URL

Rank Math’s default sitemap URL is /sitemap_index.xml. Some setups redirect /sitemap.xml to it, but not all of them do. Always test the sitemap_index.xml version first.

Step 6: Check Your Server Rewrite Rules

If you’re on Apache or LiteSpeed, open .htaccess in your site’s root folder through cPanel’s File Manager or FTP. Make sure it contains the default WordPress block:

apache

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

If it’s missing, add it, save the file, and refresh your permalinks again.

If you’re on Nginx, .htaccess does nothing. Your server config needs a rule like this:

nginx

location / {
    try_files $uri $uri/ /index.php?$args;
}

Not sure how to edit this? Ask your host to check it for you.

Step 7: Look for a Physical Sitemap File

Open your site’s root folder and check for a sitemap.xml or sitemap_index.xml file. If one exists from an old plugin or manual setup, rename or delete it. Then flush your permalinks again.

Step 8: Test for Plugin and Theme Conflicts

  1. Deactivate all plugins except Rank Math.
  2. Test the sitemap.
  3. If it works, reactivate your plugins one at a time until the sitemap breaks again.
  4. The last plugin you activated is the culprit.

If you’ve recently changed themes, switch temporarily to a default theme like Twenty Twenty-Five to rule out a theme conflict.

Step 9: Check Firewall and Security Rules

Security plugins (Wordfence, Sucuri, iThemes) and Cloudflare rules sometimes block XML requests. Review your firewall logs and whitelist /sitemap_index.xml if you find it blocked.

Special Cases

After a site migration: Re-save your permalinks, clear all caches, and confirm your site URL under Settings → General is correct.

On LiteSpeed hosting: Purge everything from the LiteSpeed Cache panel, not just the page cache.

On a multisite network: Flush permalinks on each subsite individually.

How to Verify the Fix Worked

Don’t stop at “the page loads.” Run through this checklist:

  1. Open yourdomain.com/sitemap_index.xml and confirm it lists your sitemaps.
  2. Click into post-sitemap.xml and confirm your latest posts appear.
  3. Submit the sitemap in Google Search Console → Sitemaps.
  4. Check that the status shows Success and the discovered URL count looks right.
  5. Optionally, submit it to Bing Webmaster Tools too.

Quick Troubleshooting Checklist

  • ✅ Permalinks refreshed
  • ✅ Sitemap module enabled
  • ✅ All caches cleared (plugin, server, CDN, browser)
  • ✅ No competing SEO or sitemap plugins
  • ✅ Correct URL tested (/sitemap_index.xml)
  • ✅ Server rewrite rules correct (Apache/LiteSpeed or Nginx)
  • ✅ No old physical sitemap file in the root folder
  • ✅ Firewall isn’t blocking XML files

Frequently Asked Questions

Why does my Rank Math sitemap show a 404 error?

Rewrite rules have usually broken or gone stale, so WordPress can’t resolve the sitemap URL. Cache problems, plugin conflicts, and server configuration issues can cause the same result.

How do I fix a Rank Math sitemap 404 quickly?

Go to Settings → Permalinks and click Save Changes without editing anything. This rebuilds your rewrite rules and fixes most 404 errors in under a minute.

What is the correct Rank Math sitemap URL?

It’s https://yourdomain.com/sitemap_index.xml. This index file links to your individual post, page, and taxonomy sitemaps.

Does a sitemap 404 hurt my SEO?

It can. Google can still find your pages through links, but it will discover new and updated content more slowly. Fix it quickly, especially if you publish often.

Why does my sitemap work in the browser but fail in Google Search Console?

A firewall, CDN rule, or cached response may be blocking Googlebot. Test the URL with Search Console’s URL Inspection tool and check your security logs.

Does Rank Math work on Nginx?

Yes. Nginx just needs the correct try_files rule, because it ignores .htaccess.

Final Thoughts

A Rank Math sitemap 404 looks scary, but it’s almost always a rewrite or cache problem. Refresh your permalinks first, then work down the list. If you’ve tried every step and the sitemap still returns a 404, contact your hosting provider. The issue is probably at the server level.

Did this guide fix your problem? Share it with a friend or colleague who’s fighting the same error.

Thanks for visiting our website. If you find this blog helpful, share with your firends.

Calendar

October 2026
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  

Archives