/ โ† Robots and Sitemap Fixes / Sitemap Could Not Be Read
In this guide
  1. What the two messages mean
  2. Common causes
  3. How to test the sitemap the way Google sees it
  4. What a valid sitemap looks like
  5. Platform notes
  6. A worked example
  7. The fix, step by step
  8. Edge cases worth knowing
  9. Keeping the sitemap readable
  10. Questions and answers

What the two messages mean

The Sitemaps report in Search Console shows a status for every sitemap you submit. Success means Google read it. Has errors means it read the file but found problems inside it. Couldn't fetch means Google could not get the file at all, or got something it could not use, and the error details often say Sitemap could not be read.

There are two quite different situations behind that status:

The way to tell them apart is to test the file yourself, exactly as submitted, from outside your own network. If every check below passes, give it time. If any fails, you have found the fault.

๐Ÿ’ก Paste the sitemap address into URL Inspection and run a live test. It shows whether Googlebot can fetch the URL, the status it received and whether robots.txt blocks it, which settles most arguments quickly.

Common causes

CauseWhat you see when you testFix
Wrong address submitted404, or a 301 to the home page or another fileSubmit the address your CMS or plugin really uses
HTML served instead of XMLStatus 200 but Content-Type: text/html and a web page in the bodyFix the rewrite rule or plugin conflict that sends the sitemap URL to the theme
Output before the XML declarationA blank line, a byte order mark or a PHP warning above <?xmlRemove the stray output, often whitespace after a closing ?> in a theme or plugin file
Invalid XMLBrowser shows an XML parsing error; xmllint reports a line numberEscape & in URLs, close every tag, use UTF-8
Blocked access403, a login page, a CAPTCHA or a JavaScript challenge for botsAllow verified Googlebot; remove password protection from the sitemap path
Blocked by robots.txtURL Inspection says the URL is blockedRemove the Disallow rule that matches the sitemap path
Too largeMore than 50,000 URLs or more than 50 MB uncompressedSplit into several sitemaps listed in a sitemap index
Slow or failing generationTimeouts or 5xx on large dynamic sitemapsCache or pre-generate the file; split it into smaller pieces
Cached broken copyFixed at origin but a CDN or plugin still serves the old filePurge the cache for the sitemap URLs

How to test the sitemap the way Google sees it

Start with the headers. The status must be 200, with no redirect, and the content type should be XML:

curl -sSI https://example.com/sitemap.xml

HTTP/2 200
content-type: application/xml; charset=UTF-8
content-length: 18342

A 301 or 302 means you submitted an old address; follow it with curl -sSIL to see where it ends up and submit that final URL instead. A text/html content type means something other than the sitemap generator answered.

Then repeat the request with the Googlebot user agent, because security tools often treat it differently:

curl -sS -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" https://example.com/sitemap.xml | head -c 400

The first characters must be <?xml or the opening <urlset or <sitemapindex tag. If you see <!DOCTYPE html>, a challenge page or a blank line first, that is the fault.

Check that the XML parses

curl -sS https://example.com/sitemap.xml -o sitemap.xml
xmllint --noout sitemap.xml && echo "valid XML"
grep -c "<loc>" sitemap.xml
head -c 3 sitemap.xml | xxd

xmllint prints the line and column of the first parse error, such as an unescaped ampersand. The grep counts URLs, so you can check the 50,000 limit. The last line shows the first three bytes; efbbbf is a UTF-8 byte order mark, and 0a is a stray newline. For a sitemap index, repeat the tests on two or three of the child sitemaps it lists, because one broken child is a common cause.

The robots and sitemap checker runs these tests for you and also checks that the URLs listed inside return 200.

What a valid sitemap looks like

Compare your file with this minimal version. If yours starts differently, has anything before the first line, or uses another namespace, start there.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <lastmod>2026-10-17</lastmod>
  </url>
  <url>
    <loc>https://example.com/shop/?type=garden&amp;size=large</loc>
  </url>
</urlset>

Note the ampersand in the second URL is written as &amp;. A raw & anywhere in a sitemap breaks the whole file. Every loc must be a full absolute URL on the same host as the sitemap, using the protocol your site really uses.

A sitemap index lists other sitemaps rather than pages. It cannot list another index, and each child must obey the same limits:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap><loc>https://example.com/post-sitemap.xml</loc></sitemap>
  <sitemap><loc>https://example.com/page-sitemap.xml</loc></sitemap>
</sitemapindex>

Make sure the server sends the right content type. On Apache, add this to .htaccess if it does not:

AddType application/xml .xml

On nginx, the default mime.types file already maps .xml to text/xml; check that a location block is not overriding it with default_type text/html.

Platform notes

A worked example

A site submitted /sitemap.xml two years ago and it showed Success. After a new SEO plugin was installed, the status changed to Couldn't fetch. The header test shows the cause at once:

curl -sSI https://example.com/sitemap.xml
HTTP/2 301
location: https://example.com/sitemap_index.xml

The new plugin serves its index at /sitemap_index.xml, so the cleanest fix is to give Search Console the address the sitemap really lives at. The owner submits the new address, removes the old one from the report, and adds a line to robots.txt:

Sitemap: https://example.com/sitemap_index.xml

The new sitemap shows Success later the same day, and the discovered URL count climbs over the next week.

The fix, step by step

Step 1

Test the exact submitted address

Copy the sitemap URL exactly as it appears in the Sitemaps report and request it with curl -sSI. The response must be a direct 200 with no redirect. If you get a 301 or 302, follow it with curl -sSIL and note the final address. If you get a 404, find the address your CMS or plugin really serves. Open the same URL in a private browser window too and confirm you see XML, not a web page.

Step 2

Check the content type and first bytes

Look at the content-type header from the previous test. It should be application/xml or text/xml. Then fetch the body with the Googlebot user agent and look at the first few hundred characters. The file must start with the XML declaration or the opening urlset or sitemapindex tag. A blank line, a byte order mark, a PHP warning or any HTML before it means the output needs fixing at the source.

Step 3

Validate the XML

Save the file and run xmllint --noout on it, or open it in a browser that shows XML errors. Fix the first error reported, usually an unescaped ampersand that must be written as &amp;, an unclosed tag, or text in the wrong character encoding. Check the namespace is exactly the sitemaps.org 0.9 address. Run the validator again until it reports no errors, then test two or three child sitemaps if you use an index.

Step 4

Remove access blocks

Use URL Inspection's live test on the sitemap address to see whether robots.txt blocks it, then check your security plugin, WAF and CDN logs for challenges or blocks on that path. Remove password protection, country blocks and bot challenges from sitemap URLs, and allow verified Googlebot. Confirm the fix by repeating the Googlebot user agent curl test and checking that the live test in URL Inspection reports the URL as available.

Step 5

Check size and split if needed

Count the loc entries in each sitemap file and check its uncompressed size. A single sitemap may hold at most 50,000 URLs and 50 MB. If yours is larger, or slow to generate, split it by content type or date into several smaller sitemaps and list them in a sitemap index. Make sure no index lists another index, then confirm each child returns 200 with an XML content type.

Step 6

Purge caches

Once the source is fixed, purge the sitemap URLs from every cache that might hold an old copy: your caching plugin, the server cache and the CDN. Request the sitemap again with curl and check the response headers for a cache status showing a fresh copy, such as a MISS followed by a HIT with the corrected content. Add a rule so the sitemap is cached for a short time only, or bypassed.

Step 7

Resubmit and add to robots.txt

In the Sitemaps report, remove any old or wrong sitemap addresses and submit the correct index URL. Add a Sitemap: line with the full https address to robots.txt so other crawlers find it as well. If the status shows Couldn't fetch straight after submission, wait a day or two before changing anything, because a new submission often needs time before Google processes it, and repeated resubmission does not speed that up.

Step 8

Confirm it was read

Return to the Sitemaps report after a few days and check the status shows Success, the Last read date is recent and the Discovered pages count looks right for your site. Open the sitemap's details to see whether any URLs inside it have indexing problems. If the status is still Couldn't fetch after several days and every test passes, run the URL Inspection live test again and compare its response with yours.

Edge cases worth knowing

Keeping the sitemap readable

Sitemaps break most often after a change you made for another reason: a new plugin, a theme update, a migration or a new security rule. Build a short check into each of those changes.

A regular site crawl also compares the sitemap with the pages your site really links to, which catches missing and stale entries.

Questions and answers

1. Why does Search Console say Couldn't fetch for a new sitemap?

A newly submitted sitemap often shows Couldn't fetch simply because Google has not processed it yet. If the file returns a direct 200, is served as XML and parses without errors, wait a day or two and check again before changing anything. If the status is still the same after that, test the address with curl and URL Inspection, because a redirect, a block or HTML in place of XML is the real cause in most lasting cases.

2. What content type should a sitemap use?

A sitemap should be served with an XML content type, either application/xml or text/xml, usually with charset UTF-8. Most servers do this automatically for files ending in .xml, and sitemap plugins set it themselves. Problems arise when a rewrite rule sends the sitemap address to the theme, or a server block forces text/html, so the browser shows a web page rather than XML. Check the content-type header with curl -I to see what your server really sends.

3. Can a redirect cause Sitemap could not be read?

Yes, a redirect on the submitted sitemap address is one of the most common causes. Search Console expects the address you submitted to return the sitemap directly with status 200. This often happens after changing SEO plugin, moving from http to https, or switching between www and non-www. Find the final address with curl, submit that address in the Sitemaps report, remove the old entry and update the Sitemap line in robots.txt so everything points at one URL.

4. How many URLs can one sitemap contain?

One sitemap file can contain up to 50,000 URLs and must be no larger than 50 MB uncompressed. Sites with more pages split them into several sitemaps and list those in a sitemap index, which can itself list up to 50,000 sitemaps. Splitting by content type, such as products, categories and posts, also makes problems easier to find, because the Sitemaps report then shows which group has errors. Large dynamic sitemaps that are slow to generate are another reason to split.

5. Does a firewall or Cloudflare block my sitemap from Google?

It can, if a security rule challenges or blocks the sitemap path for bots. Googlebot cannot pass a CAPTCHA or a JavaScript challenge, so it receives an HTML page instead of your XML and cannot read it. Check your security logs for events on the sitemap address, confirm the blocked requests come from genuine Googlebot addresses, and exclude sitemap URLs from challenges. Verified search engine crawlers are usually allowed by default, but custom rules can override that.

6. Should I submit every child sitemap or just the index?

Submit the sitemap index and let Google find the child sitemaps from it. This keeps the Sitemaps report tidy, and new child sitemaps that your plugin adds later are picked up automatically. Search Console still shows the children under the index, so you can see which one has a problem. Add the index address to robots.txt with a Sitemap line as well, so other search engines and crawlers that never see your Search Console account can find it.

7. My sitemap shows Success but pages are still not indexed. Why?

A sitemap that Google can read only helps it discover URLs; it does not guarantee they will be indexed. Google still decides for each page whether to crawl and index it, based on quality, duplication, canonical tags, noindex rules and how important the page appears. Check the indexing status of the listed URLs in the Page indexing report, filtered to that sitemap. Make sure the sitemap lists only canonical, indexable pages that return 200, and link to them from your own pages.

Check your sitemap and robots.txt together

The robots and sitemap checker fetches your sitemap as a crawler would, checks the status, content type, XML and size limits, and tests the URLs it lists.

Open Robots and Sitemap Fixes โ†’
๐Ÿ’ฌ Got a problem?
Related Guides: All Robots and Sitemap Fixes  ·  How to fix sitemap index issues in WordPress  ·  How to fix sitemap size limits  ·  How to fix the sitemap declaration in robots.txt  ·  How to fix robots.txt unreachable errors  ·  Learning Hub

About aiwebpageseo

aiwebpageseo.com is a data-driven SEO and AEO (Answer Engine Optimisation) platform providing a free suite of technical SEO tools. Rather than relying on AI-theorised assumptions, the platform analyses live URL performance, delivering objective diagnostics, page speed metrics, CLS debugging, and site crawl data alongside actionable technical tutorials.