← Back to the blog
Technical SEO

Couldn't fetch sitemap: test the request before editing the XML

A fetch failure is a server or network problem, not a parsing problem. Check DNS, TLS, status codes, redirects and bot protection with the exact URL Google uses.

By Launcholio6 min read

A failed fetch is not a bad XML file

When Search Console says it could not fetch or read the sitemap, Google never reached the document. Editing the XML will not help until the request path works.

Start with the exact URL from the sitemap row. Reproduce the request without cookies, without a browser session, and with redirects followed. The response you get is the evidence to work from.

curl -sSIL https://example.com/sitemap.xml
curl -sS -o body.txt -w "%{http_code} %{content_type} %{size_download}\n" https://example.com/sitemap.xml
head -c 200 body.txt

Work through the layers in order

Each layer produces a different fix. A 404 is a route problem; a 403 or challenge page is an access rule; a 5xx or timeout is origin reliability; a 200 with HTML is a rewrite or fallback problem.

ObservationLikely causeFix
DNS or TLS errorWrong host, expired certificate, missing DNS recordCorrect the host and certificate
404 or 410Route missing or file not deployedDeploy the file at the submitted URL
301/302 to another hostProtocol or host normalisationSubmit the final URL directly
403 or challenge pageFirewall, CDN rule, bot protectionAllow verified crawlers to fetch the public XML
5xx or timeoutOrigin overloaded or too slowFix the endpoint and check response time
200 with HTMLSPA fallback or login redirectServe XML, not the app shell

Check redirects and the submitted URL

Google reports the URL you submitted, not the URL you meant to submit. A missing slash, an http URL, or a www variant can add a redirect hop that fails at the edge.

Follow every hop manually and submit the final address. If the site redirects http to https or www to non-www, use the destination in the sitemap and in the Search Console submission.

  • Submit the exact final URL, not an alias.
  • Avoid chains of more than one redirect.
  • Confirm the sitemap is reachable without signing in.
  • Check that the response is XML, not gzip-encoded text the client cannot read.

When the fix is bot protection

A challenge page is often invisible to a normal browser session because the browser solves it. Fetch with a plain client and look for HTML, a CAPTCHA script, or a 403 instead of XML.

Allow verified search crawlers on the public sitemap path and keep the protection for private routes. After the rule changes, re-fetch the URL and resubmit it.

Frequently asked questions

The sitemap opens in my browser. Why does Google fail? Your browser may be signed in, cached, or able to solve a challenge. Test with a plain HTTP client and no cookies.

Should I resubmit every day? No. Fix the response, fetch it yourself, then resubmit once and check the last-read time.

Could the sitemap be too large? A fetch failure is not the usual symptom of size; an oversized file usually fails validation after a successful download.

Confirm Google can reach the page

Run the URL through a free audit to separate an access problem from a content problem.

Run a free audit