More fixes

WordPress sitemap: "Couldn't fetch" or "Sitemap could not be read"

You add your sitemap in Google Search Console and the Sitemaps report says "Couldn't fetch", "Sitemap could not be read" or "Sitemap is HTML". Google tried to download the list of your pages and either got nothing, got an error page, or got something that is not a valid sitemap. New pages then wait longer to show up in Google. Usually the address is wrong, a plugin prints a blank line before the XML, a security setting blocks Google, or the site is set to hide from search engines. Here is how to tell which.

What the owner sees

search.google.com/search-console/sitemaps

What the checks found


  

Which problem is it? (five minutes)

  1. Open the exact address you submitted in a private browser window. A "page not found" means the address is wrong for your setup. WordPress's own sitemap is /wp-sitemap.xml; Yoast SEO and Rank Math use /sitemap_index.xml and switch the WordPress one off. Plain /sitemap.xml only works if a plugin or the host makes it.
  2. If it opens, look at the very top. A browser message such as "XML declaration allowed only at the start of the document" or "error on line 2" means something prints a blank line or text before the sitemap. Google reads that as unreadable.
  3. If you see your normal home page or a styled web page instead of a list, a caching, redirect or "coming soon" plugin is answering for the sitemap. Search Console calls this "Sitemap is HTML".
  4. Check Settings, Reading. If "Discourage search engines from indexing this site" is ticked, WordPress turns its own sitemap off, and many SEO plugins tell Google to stay away. This is often left on after a site launch.
  5. Ask Google directly. In Search Console, paste the sitemap address into URL Inspection and run Test live URL. "Blocked by robots.txt", a 403 or a 5xx here, while the address opens fine for you, means a firewall, security plugin or CDN bot setting is turning Googlebot away.
  6. Look at the date. A sitemap submitted in the last day or two can show "Couldn't fetch" while Google has simply not read it yet. If steps 1 to 5 pass, wait a few days before changing anything.

Fix it, safest first

  1. Submit the right address. In Search Console, Sitemaps, remove the old entry and submit the one that opened in step 1. One sitemap index is enough; do not submit both the WordPress and the plugin sitemap.
  2. Get a 404 sitemap working: go to Settings, Permalinks and press Save Changes without changing anything. That rebuilds WordPress's address rules and fixes most sitemaps that return "page not found" right after a plugin was installed or a site was moved. In Yoast or Rank Math, switch the sitemap setting off and on again.
  3. Untick "Discourage search engines" in Settings, Reading if the site is live, then resubmit.
  4. Remove the blank line before the XML. It almost always comes from a theme or plugin file with an empty line or a closing ?> at the very end, often functions.php. Deactivate plugins one at a time (on a copy or in a quiet hour) until the sitemap's top line starts with <?xml, then update or replace that one. The headers already sent guide covers the same stray-output cause.
  5. Exclude the sitemap from caching and redirects. Add wp-sitemap or sitemap to the caching plugin's never-cache list and clear the cache. Turn off any coming-soon or maintenance mode on a live site.
  6. Let Googlebot through. In the security plugin or the CDN, allow verified search engine bots and take the sitemap address off any challenge or rate-limit rule. In robots.txt, remove any Disallow line that covers the sitemap, and add a Sitemap: line with its full address.
  7. Resubmit and re-test. Run URL Inspection's live test on the sitemap again, then resubmit it in the Sitemaps report. The status usually changes to "Success" within a few days.

What you see, what it means, what it needs

What you seeWhat it meansUsual fix
"Couldn't fetch", and the address gives "page not found"Wrong sitemap address, or address rules not rebuiltSubmit /wp-sitemap.xml or /sitemap_index.xml; Save Permalinks
"Sitemap could not be read", browser says "XML declaration allowed only at the start"A blank line or text is printed before the XMLFind the plugin or theme file with the stray output
"Sitemap is HTML"A cache, redirect or coming-soon page answers insteadExclude the sitemap from caching; turn off coming-soon
Sitemap opens for you, live test shows 403, 5xx or robots.txt blockGooglebot is blockedAllow verified bots in the firewall or CDN; fix robots.txt
Sitemap gone after launch, Site Health warns about visibility"Discourage search engines" is still tickedUntick it in Settings, Reading; resubmit
"Couldn't fetch" the same day you submitted, everything else passesGoogle has not read it yetWait a few days; do not resubmit repeatedly

What not to do

Most cases are the wrong address or a forgotten "Discourage search engines" tick, fixed in a few minutes. If the blank line or the bot block will not go away, that is what the box below is for. Related: site not on Google, wrong search snippet, headers already sent.