Satelo / WordPress / WordPress Sitemap Not Working? A Fix Tree for 404s and Errors
Wordpress

WordPress Sitemap Not Working? A Fix Tree for 404s and Errors

When a WordPress sitemap is not working, the cause is almost always one of five things: you are opening the wrong sitemap URL, two sitemap generators are fighting, rewrite rules need a refresh, a cache or security layer is serving the wrong response, or the site is set to discourage search engines. This guide gives you a fix tree you can walk in order, from the 30-second checks to the server-level ones, plus what each Search Console sitemap error actually means.

Published: 2026-11-24 · 7 min read · Satelo

WordPress Sitemap Not Working? A Fix Tree for 404s and Errors

First: which sitemap should your site have?

Half of "sitemap not working" reports are someone opening /sitemap.xml on a site whose sitemap lives somewhere else. Each generator uses its own address:

GeneratorUsual sitemap URLNotes
WordPress core (5.5 and later)/wp-sitemap.xmlBuilt in; covers public post types, taxonomies, authors and the home page
Yoast SEO/sitemap_index.xmlTurned on under Yoast SEO → Settings → Site features
Rank Math/sitemap_index.xmlSitemap module must be enabled
Other sitemap plugins or a static fileOften /sitemap.xmlA physical file in the web root overrides everything

The core sitemap index and its behavior are described in the WordPress team's announcement of sitemaps in WordPress 5.5. Yoast's own sitemap help page warns that a sitemap at /sitemap.xml is not one Yoast generates, so checking that address tells you nothing about Yoast.

Quick test: open yoursite.com/robots.txt. WordPress core and most SEO plugins add a Sitemap: line there pointing to the sitemap they actually serve. Open that URL, not a guessed one.

The fix tree

Walk these in order. Stop at the first step that fixes it, then jump to "Confirm the fix" at the end.

1. Is the site hidden from search engines?

Go to Settings → Reading and look at "Search engine visibility." If "Discourage search engines from indexing this site" is ticked, the WordPress announcement says core sitemaps are disabled. This box is often left on after a staging copy goes live. Untick it, save, and test again.

2. Flush the rewrite rules

Sitemaps are virtual URLs: WordPress answers them through rewrite rules, not files on disk. If those rules are stale (after a migration, a plugin switch or a permalink change), you get a 404.

  1. Go to Settings → Permalinks.
  2. Do not change anything. Click "Save Changes."
  3. Reload the sitemap URL in a private window.

This one step fixes a large share of sitemap 404s. If you use "Plain" permalinks (?p=123), switch to any pretty structure; the WordPress announcement's author recommends making sure pretty permalinks are enabled when troubleshooting.

3. Remove the conflict between generators

Run exactly one sitemap generator. Typical conflicts:

After removing a generator, flush permalinks again (step 2).

4. Bypass caching and optimization plugins

Page caches, minifiers and CDNs sometimes store an old 404 or an HTML error page for the sitemap URL, or "optimize" the XML into something invalid.

Our guide to fixing a slow WordPress site covers how to set cache exclusions without losing the speed benefit.

5. Check security plugins and the firewall

Security plugins and host firewalls can block bots by user agent or rate. If your browser loads the sitemap but Search Console says "Couldn't fetch," something may be blocking Googlebot specifically. Look in the security plugin's log for blocked requests to the sitemap URL, and make sure verified search engine crawlers are allowed.

6. Look for PHP errors and stray whitespace

A blank page or "XML declaration allowed only at the start of the document" error usually means something printed output before the XML. Common culprits are a blank line before <?php in functions.php or a plugin throwing a warning. Google's sitemap report lists "Leading whitespace" as a warning it can still process, but PHP warnings inside the XML will break parsing. Turn on WP_DEBUG_LOG, load the sitemap, and read wp-content/debug.log.

7. Server-level rewrites (Apache vs Nginx)

If permalinks flush but sitemap URLs still 404 while normal pages work, the server is not passing those URLs to WordPress. On Apache, check that .htaccess contains the standard WordPress block and that the host allows overrides. On Nginx, .htaccess is ignored entirely; the site config needs a try_files rule that hands unknown URLs to index.php, which managed hosts usually set for you. If you cannot edit server config, ask your host.

What Search Console sitemap errors mean

Google's Sitemaps report help lists every status. These are the ones WordPress sites hit most:

Search Console saysWhat it meansLikely WordPress cause
Couldn't fetchGoogle could not retrieve the fileWrong URL submitted, 404, firewall block, or a temporary server error
Blocked by robots.txtrobots.txt disallows the sitemapA Disallow rule written by hand or by a plugin
Parsing error / Unsupported formatGoogle could not read the XMLHTML error page served instead of XML, PHP warnings, minification
Path mismatch: missing www / includes wwwSitemap host and listed URLs differSettings → General uses a different host than the one you submitted
URL not allowedListed URLs are on another domain or higher in the pathLeftover staging or old-domain URLs after a migration
Nested sitemap indexesAn index lists another indexYou submitted a plugin index that links to the core index, or the reverse
Empty sitemapNo URLs in the filePost type excluded in plugin settings, or no published content of that type
Sitemap contains URLs blocked by robots.txtSome listed URLs are disallowedSitemap includes sections you blocked; fix one or the other

The same help page says a "Temporary error" usually resolves on its own without resubmitting.

Limits and rules worth knowing

From Google's guide on building a sitemap:

WordPress core splits its own sitemaps at 2,000 entries each by default, per the 5.5 announcement, so a small blog's core sitemap is usually an index with a few short child files. That is normal, not an error.

Worked example (illustrative)

An illustrative case, not a real site: a blog moved from Yoast to Rank Math. Search Console shows "Couldn't fetch" for /sitemap_index.xml, and the browser shows a 404. Walking the tree:

  1. Search engine visibility: off, fine.
  2. Flush permalinks: still 404.
  3. Generators: Yoast is deactivated but a sitemap plugin from years ago is still active and has a physical sitemap.xml in the root. Deactivate it, delete the file, enable Rank Math's sitemap module, flush permalinks again.
  4. The index loads, but a CDN still serves the cached 404 to some visitors. Purge the CDN and exclude sitemap URLs from caching.

Result: one sitemap, one URL, one Sitemap: line in robots.txt, resubmitted in Search Console.

Confirm the fix

  1. Open the sitemap in a private window. You should see XML (browsers may style it as a table), not your theme's 404 page.
  2. Open robots.txt and confirm the Sitemap: line points to that same URL.
  3. In Search Console, remove sitemaps you no longer serve and submit the current one.
  4. Spot-check a few URLs from the sitemap in URL Inspection.
  5. Optional: ping faster discovery with IndexNow for Bing and Yandex; see our IndexNow for WordPress guide.

If the sitemap loads but pages still are not indexed, the sitemap was not the bottleneck. Read Discovered, currently not indexed for the next layer.

Keep it from breaking again

What to do next

A working sitemap gets your pages found; it does not get anyone talking about them. The Satelo WordPress plugin connects your site to a small public-beta network where similar sites publish articles about each other in a circle, with one-click login and auto-publishing. Every exchange link is marked rel="sponsored", and the plugin is free.

FAQ

What is the default WordPress sitemap URL?

Since WordPress 5.5, core serves a sitemap index at /wp-sitemap.xml. SEO plugins like Yoast and Rank Math replace it with their own, usually at /sitemap_index.xml. Check the Sitemap line in your robots.txt to see which one your site uses.

Why does my WordPress sitemap show a 404?

Most often the rewrite rules are stale. Go to Settings, Permalinks and click Save Changes without editing anything. If that does not help, check for conflicting sitemap plugins, a leftover physical sitemap.xml file, or caching.

Why is my WordPress sitemap blank?

A blank page usually means a PHP error or output before the XML declaration. Enable WP_DEBUG_LOG, reload the sitemap, and check wp-content/debug.log.

Why does Search Console say Couldn't fetch for my sitemap?

Google could not retrieve the file. Check that you submitted the exact URL your site serves, that it loads in a private window, and that a firewall or security plugin is not blocking Googlebot.

Does Discourage search engines disable the sitemap?

Yes. The WordPress 5.5 announcement says core sitemaps are disabled when the site visibility setting discourages search engines.

Should I use the core sitemap or a plugin sitemap?

Either works. What matters is running only one generator, keeping a single Sitemap line in robots.txt, and submitting that URL in Search Console.

Satelo team
We build Satelo, a network where small websites promote each other. About us

Read next

Noindex Tag Pages in WordPress: When to Hide Them and HowShould you noindex tag pages in WordPress? A 4-question test, exact toggles in Yoast, Rank Math and AIOSEO, and how to find and remove a stray noindex tag.
WP Rocket vs LiteSpeed Cache: Let Your Server DecideWP Rocket vs LiteSpeed Cache for a small WordPress blog: check your server first, then compare features, cost, setup and what each does for Core Web Vitals.
WordPress and ChatGPT Search: Five Places Your Site Blocks OAI-SearchBotIs your WordPress site invisible to ChatGPT? Check 5 layers that can block OAI-SearchBot: Reading settings, robots.txt, SEO plugins, Wordfence and Cloudflare.
Best Blogging Platform for SEO: An Honest Comparison by CriteriaThe best blogging platform for SEO is the one that gives you your own domain, HTML control and an easy exit. WordPress, Ghost, Substack and others compared.

Check your site's Quality Score

Free, no sign-up: a 0–100 score from mostly open data. Then add your site to Satelo and get partner articles from sites of your level.

Add my site