My WordPress Sitemap Returns a 404

This guide covers what to check when the sitemap URL of your WordPress site returns a “page not found” error in your browser or when Google Search Console reports that it cannot fetch the sitemap.

Use the CrawlWP sitemap address

CrawlWP uses WordPress’s built-in XML sitemap. The sitemap index is available at https://your-site.com/wp-sitemap.xml.

Do not use sitemap URLs that belonged to an SEO plugin you previously had installed. With CrawlWP, these addresses behave differently:

PluginOld sitemap addressWith CrawlWP
Yoast SEO, Rank Math/sitemap_index.xml404
SEOPress/sitemaps.xml404
All in One SEO, The SEO Framework, Slim SEO/sitemap.xmlRedirects to /wp-sitemap.xml

The individual sitemap files used by those plugins, such as /post-sitemap.xml, also return 404 with CrawlWP.

To open the sitemap from the WordPress dashboard, go to CrawlWP > Settings, make sure the Settings tab is selected, choose Sitemap from the left-hand menu, and click Open Sitemap.

If you recently changed SEO plugins

Google Search Console may still contain a sitemap address from Yoast SEO, Rank Math, or SEOPress. That old address can continue to produce errors even though the CrawlWP sitemap is working correctly.

  1. Open Sitemaps in Google Search Console.
  2. Remove the old sitemap submission.
  3. Submit wp-sitemap.xml instead. See Submitting your sitemap to Google Search Console.

You can also redirect an old sitemap URL when you still have links or references pointing to it. For example, create a 301 redirect from /sitemap_index.xml or /sitemaps.xml to https://your-site.com/wp-sitemap.xml. See Creating a redirect (301, 302, 410).

When /wp-sitemap.xml itself returns 404

Work through these checks in order and reload /wp-sitemap.xml after each change. The first two are the most important because they control whether WordPress can serve the sitemap at all.

1. Check search engine visibility

WordPress disables its XML sitemap when Discourage search engines from indexing this site is enabled. In that state, /wp-sitemap.xml returns 404.

  1. Go to Settings > Reading.
  2. Untick Discourage search engines from indexing this site.
  3. Click Save Changes.
The Search engine visibility setting

CrawlWP also shows a notification when this setting is enabled. Check the bell icon in the admin bar.

2. Refresh WordPress’s permalink rules

WordPress relies on rewrite rules to serve the friendly /wp-sitemap.xml address. Those rules can become stale after changes such as a migration.

  1. Go to Settings > Permalinks.
  2. Click Save Changes without changing the selected structure.

Pay particular attention to the Permalink structure. When Plain is selected, WordPress does not use rewrite rules and the sitemap is available at https://your-site.com/?sitemap=index instead. Choose another structure, such as Post name, to make /wp-sitemap.xml work.

CrawlWP also warns about plain permalinks through its notifications.

3. Check whether another plugin disabled the WordPress sitemap

Another SEO or sitemap plugin can turn off the WordPress XML sitemap. When CrawlWP reports The WordPress XML sitemap is disabled. and search engine visibility is already enabled, look for another plugin that controls XML sitemaps.

Deactivate other SEO and sitemap plugins one at a time, testing /wp-sitemap.xml after each change. This makes it easier to identify which plugin is responsible.

4. Clear caches before assuming the sitemap is still broken

A caching plugin, hosting cache, or CDN can keep an earlier 404 response. Clear the relevant caches and then test the sitemap again in a private browser window.

5. Check whether the web server is intercepting the request

Some web server configurations, particularly Nginx setups, can handle requests for .xml files without passing them to WordPress. When that happens, the server can return its own 404 page instead of allowing WordPress to generate the sitemap.

Ask your hosting provider to verify that requests that do not match a real file are passed to WordPress’s index.php. A security plugin or firewall can also block sitemap requests, so check its logs or briefly pause it as a test.

When the sitemap index works but one sitemap is missing

A working /wp-sitemap.xml does not guarantee that every individual sitemap URL you remember from an older setup still exists. Check what the current index actually lists before treating a missing child sitemap as a problem.

  • A post type, taxonomy, or author sitemap. CrawlWP removes a sitemap when that content is set to Hide from search results. See Choosing what appears in your sitemap.
  • A numbered sitemap such as wp-sitemap-posts-post-2.xml. Each sitemap contains up to 2,000 addresses. When the site later has fewer posts or other URLs, a previously existing numbered sitemap may no longer be needed.
  • A news, video, or custom URLs sitemap. These Premium sitemap types only exist while they are enabled in the Sitemap settings. See Understanding CrawlWP sitemaps.

Search Console can retain references to older sitemap URLs after your site’s configuration changes. Remove obsolete submissions under Sitemaps and submit only wp-sitemap.xml. The sitemap index takes care of linking to the current child sitemaps.

When browser and Search Console results disagree

The sitemap opens in my browser, but Search Console says “Couldn’t fetch”. Search Console can continue showing an error for a while after a sitemap is submitted. Give it a day and check again. When the error persists, use Google’s URL Inspection tool on the sitemap URL to see what Google receives.

The sitemap works, but robots.txt does not list it. A physical robots.txt file may be replacing WordPress’s generated version, or the content saved in CrawlWP’s Robots.txt section may not contain a Sitemap: line. See My robots.txt changes aren’t taking effect.

The sitemap is showing another plugin’s format. Another sitemap plugin is still generating or handling the sitemap. Deactivate that plugin and test /wp-sitemap.xml again.

The quickest way to isolate the cause

First confirm that you are opening /wp-sitemap.xml, then check Settings > Reading, refresh Settings > Permalinks, and rule out plugins, caches, and server-level handling. Once the sitemap works directly in a browser, update any old Search Console submission so Google is using the current sitemap index.

Still need help?

Our support team usually replies within one business day. Send your site URL and what you have already tried — that context saves a round trip.