Fix Your Sitemap Appears to Be an HTML Page: 8 Causes Tested
Your sitemap appears to be an HTML page means Google got HTML, not XML. I tested 8 causes. Two hit only Googlebot, so it looks fine in your browser.

TL;DR — Your sitemap appears to be an HTML page is the Search Console error Google shows when the sitemap URL you submitted returned an HTML document instead of XML, RSS or text. I tested 8 server setups with a probe that fetches the URL as Googlebot and as a browser, then checks what is actually in the body. A SPA fallback, a redirect to the homepage, a maintenance page, a bot challenge and a bot-only cache variant all send HTML, and the last two do it only to Googlebot. Find the layer that answered, make it return the XML file, and resubmit.
The error is easy to dismiss because the sitemap usually opens fine when you click it. That’s exactly why it lingers: the layer causing it is often one that only kicks in for crawlers.
What Does Sitemap Is HTML Mean in Search Console?
It means Google fetched your sitemap URL and got a web page back. The Sitemaps report flags the file with the error Sitemap is HTML and the detail line “Your Sitemap appears to be an HTML page. Please use a supported sitemap format instead.”
Google’s sitemap documentation lists three supported formats: XML, RSS/mRSS/Atom 1.0, and plain text. Each one is limited to 50 MB uncompressed or 50,000 URLs, and the file must be UTF-8. HTML isn’t on that list, so an HTML response is rejected no matter what links it contains.
Google’s Sitemaps report help page doesn’t document the HTML case on its own row. Its nearest entry is Unsupported format, and it files a 404 under Couldn’t fetch. Google also doesn’t publish how it decides a response is HTML. So the useful question isn’t what Google’s rule is. It’s what your server actually sent.
| What the URL returned | What Search Console reports | Where to read more |
|---|---|---|
| HTML page with a 200, or after a redirect | Sitemap is HTML | This post |
| 404 or another 4xx | Couldn’t fetch / HTTP error | Sitemap couldn’t fetch |
| XML with broken syntax or a wrong namespace | Parsing error / Unsupported format | Google’s Sitemaps report help |
| Valid XML listing blocked pages | Warning, sitemap still processed | Blocked sitemap URLs |
Which Server Setups Send HTML Instead of a Sitemap?
I built a local server with one port per failure mode, each serving /sitemap.xml in a way I’ve seen in real reports. Then I ran the probe from the next section against every port. It fetches the URL twice, once with Googlebot’s user agent and once with a desktop Chrome user agent, follows redirects by hand, and checks the first element in the body after any XML declaration, stylesheet instruction or comment.
Setup serving /sitemap.xml | Googlebot gets | Browser gets | Verdict |
|---|---|---|---|
Healthy XML, application/xml | 200, <urlset> | 200, <urlset> | Pass |
SPA fallback (every unknown path → index.html) | 200, HTML app shell | 200, HTML app shell | Fail |
| 301 redirect to the homepage | 200 HTML after 301 → / | Same | Fail |
| Maintenance / “Coming soon” plugin | 200, HTML | 200, HTML | Fail |
| Bot challenge for Googlebot’s user agent | 403, “Just a moment…” HTML | 200, <urlset> | Fail, bot-only |
| CDN cache variant keyed on user agent | 200, cached HTML | 200, <urlset> | Fail, bot-only |
XML body sent as text/html | 200, <urlset> | 200, <urlset> | Pass, header warning |
| XML with an XSL stylesheet | 200, <urlset> | 200, <urlset> | Pass |
Five of eight sent HTML. Three of those you’d catch by opening the URL yourself. The other two pass every browser check you’ll ever do, because the HTML only goes to requests that look like Googlebot.
The last two rows clear up two common myths. An XSL-styled sitemap renders like a web page in Chrome, but the bytes are still XML, so it’s not the cause. A wrong Content-Type header is worth fixing because it’s sloppy, but the body is still a sitemap. Google doesn’t document whether it trusts the header or the body, so fix it, but don’t stop there if the error stays.
A Script That Fetches Your Sitemap as Googlebot and as a Browser
This is the probe behind the table. It needs Node 18+ and no dependencies. It strips a byte-order mark, skips the XML declaration, any xml-stylesheet instruction and leading comments, then labels the body as a sitemap, a feed, HTML, empty, or unknown. The interesting output is when the two lines disagree.
// probe-sitemap.mjs — node probe-sitemap.mjs <sitemap-url>
const url = process.argv[2];
const AGENTS = {
googlebot: 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
browser: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 14_0) AppleWebKit/537.36 Chrome/131 Safari/537.36',
};
async function fetchAs(ua) {
let u = new URL(url); const hops = [];
for (let i = 0; i <= 5; i++) {
const r = await fetch(u, { redirect: 'manual', headers: { 'user-agent': ua }, signal: AbortSignal.timeout(10000) });
const loc = r.headers.get('location');
if (r.status >= 300 && r.status < 400 && loc) { hops.push(`${r.status} → ${loc}`); u = new URL(loc, u); continue; }
const body = (await r.text()).replace(/^/, '');
return { status: r.status, type: r.headers.get('content-type') || '-', hops, body, final: u.href };
}
return { status: 'too-many-redirects', type: '-', hops, body: '', final: u.href };
}
// What is actually in the body, ignoring headers and how a browser would render it.
function sniff(body) {
const head = body.replace(/^s*(<?xml[^>]*?>s*)?(<?xml-stylesheet[^>]*?>s*)?(<!--[sS]*?-->s*)*/i, '');
if (/^<(urlset|sitemapindex)/i.test(head)) return 'sitemap-xml';
if (/^<rss|^<feed/i.test(head)) return 'feed';
if (/^<!doctype html|^<html/i.test(head) || /<(head|body)/i.test(body.slice(0, 2000))) return 'HTML';
return head.trim() === '' ? 'empty' : 'unknown';
}
const results = {};
for (const [who, ua] of Object.entries(AGENTS)) {
const r = await fetchAs(ua); const kind = sniff(r.body);
const title = (r.body.match(/<title>([^<]*)</title>/i) || [])[1];
results[who] = kind;
console.log(`${who.padEnd(9)} ${String(r.status).padEnd(4)} ${r.type.padEnd(24)} body=${kind}` +
(title ? ` title="${title}"` : '') + (r.hops.length ? ` via ${r.hops.join(', ')}` : ''));
if (kind === 'sitemap-xml' && !/xml/i.test(r.type)) console.log(` warn: XML body sent as ${r.type}`);
}
const verdict = results.googlebot === 'sitemap-xml' ? 'OK' : 'FAIL';
const note = results.googlebot !== results.browser ? ' (Googlebot sees something different from your browser)' : '';
console.log(`verdict: ${verdict}${note}`);
process.exitCode = verdict === 'OK' ? 0 : 1;Here’s the bot-challenge case. The <title> in the HTML usually names the layer that answered:
googlebot 403 text/html body=HTML title="Just a moment..."
browser 200 application/xml body=sitemap-xml
verdict: FAIL (Googlebot sees something different from your browser)It exits non-zero on a failure, so you can drop it into CI after a deploy. One limit: a user agent string doesn’t make you Googlebot. A firewall that checks Google’s IP ranges will treat this probe like any other visitor. A clean result rules out the user-agent rules, but only the URL Inspection live test runs from Google’s own network.
How to Fix Your Sitemap Appears to Be an HTML Page in 6 Steps
Copy the exact URL from the Sitemaps report. Don’t retype it. Most SPA-fallback cases are a typo, such as
sitemap_index.xmlsubmitted when the file issitemap-index.xml. Your router sends the missing path to the app shell, and the app shell is HTML.Run the probe on that URL. If both lines say
HTML, the problem is on your origin: a fallback, redirect or maintenance page. If only the Googlebot line saysHTML, it’s a layer in front of the origin.Read the
<title>and the redirect chain. “Just a moment…”, “Attention Required” or a vendor name means a bot challenge. A301 → /means a redirect rule is catching the sitemap. Your app’s own title means a fallback route answered.Make the sitemap path a real file or an explicit route. For a SPA, generate the sitemap at build time into the static output so it’s served before any fallback rule. In WordPress, turn off the maintenance or “coming soon” mode for crawlers, or exempt
/sitemap*.xml.Exempt sitemaps from bot protection and user-agent caching. Add a firewall skip rule for
/sitemap*.xmland/robots.txt. If you must let verified crawlers past a challenge, match them by IP range, not user agent. Purge any cached copy of the sitemap URL after the change.Run URL Inspection’s live test on the sitemap URL, then resubmit. The live test fetches from Google’s network, so it’s the only check that sees what Googlebot sees. When it shows the XML, resubmit in the Sitemaps report and wait for the status to change to Success.
Which Layer Is Serving the HTML?
A sitemap request passes through up to four layers before your sitemap generator answers it. Any one of them can answer first with HTML. The diagram follows the order of the layers, and the probe’s two lines tell you which half to look in.
| Layer | Who gets HTML | Typical cause | Fix |
|---|---|---|---|
| CDN / WAF | Googlebot only | Bot-fight mode, JS challenge, rate limit on crawlers | Skip rule for /sitemap*.xml; audit which rule fired |
| Edge cache | Googlebot only | Cache key includes user agent, or an HTML variant was cached | Purge the URL; don’t vary sitemap cache on user agent |
| Origin router | Everyone | SPA fallback, redirect rule, i18n prefix redirect | Serve the sitemap as a static file before any fallback |
| CMS / plugins | Everyone | Maintenance mode, a second SEO plugin taking over the route | Disable the conflicting plugin or exempt sitemaps |
A quick way to tell an SPA fallback from a missing file: a real 404 shows up as Couldn’t fetch, not Sitemap is HTML. When I ran the probe against a mistyped URL on this site, /sitemap_index.xml, it came back 404 text/html with the site’s “Not found” page. That’s an HTML body too, but with a 404 status, so Search Console files it under the fetch error. The three real sitemaps here, /sitemap-index.xml, /sitemap.xml and /blog-sitemap.xml, all returned 200 application/xml with a <sitemapindex> or <urlset> body for both user agents, served from Cloudflare’s edge cache. They’re prerendered at build time, so no fallback route ever touches them.
When Is the Error Not Worth Chasing?
When the URL you submitted was never meant to be a sitemap. A plugin’s human-readable /sitemap/ page, an old URL from a previous CMS, or a feed you no longer publish will all show this error forever. Delete that entry from the Sitemaps report and make sure the real file is submitted.
Chase it when it’s your main sitemap, or when the error appeared after a change to your CDN, firewall or hosting. New pages lean on the sitemap to be found, and a sitemap Google can’t read leaves them waiting in Discovered – currently not indexed. Once the file is readable again, make sure every URL in it matches the sitemap’s host and folder with the URL not allowed checker, check its dates with the lastmod guide and look for pages it leaves out using the orphan pages audit. The rest of this Search Console series is in the AI search hub.
FAQ
What does Sitemap is HTML mean in Search Console?
It means Google fetched the URL you submitted and got an HTML document back instead of a sitemap. Google supports XML, RSS or Atom, and plain text sitemaps, so an HTML page is never accepted.
Why does my sitemap look fine in the browser but Search Console says it is HTML?
Because something in front of your server treats Googlebot differently. A bot challenge, a firewall rule, or a cache variant can hand Googlebot an HTML page while your browser gets the real XML. Fetch the sitemap with a Googlebot user agent, and check the URL Inspection live test.
Does an XSL stylesheet make Google think my sitemap is HTML?
No. An XSL stylesheet only changes how a browser displays the file. The bytes Google downloads are still XML that starts with a urlset or sitemapindex element, and in my test the styled sitemap passed the same body check as the plain one.
Should I submit my HTML sitemap page to Search Console?
No. A human-readable HTML sitemap page is fine for visitors, but the Sitemaps report only accepts XML, RSS or Atom, and text files. Submit the XML file your CMS or framework generates.
How long does it take for the Sitemap is HTML error to clear?
Google re-reads submitted sitemaps on its own schedule, which can take days. Once the URL returns XML to Googlebot, resubmit it in the Sitemaps report to ask for a fresh fetch.
Sources
- Google Search Central, Build and submit a sitemap: supported formats (XML, RSS/mRSS/Atom 1.0, text), the 50 MB / 50,000 URL limit, UTF-8 encoding, and the robots.txt
Sitemap:line. - Google Search Console Help, Manage your sitemaps using the Sitemaps report: the documented sitemap errors, including Couldn’t fetch for 404s and Unsupported format.
- Community reports of the exact error message and its causes (maintenance pages, redirects, cache plugins), for example this WordPress.org support thread.
- First-party test: a local server with eight
/sitemap.xmlsetups, each fetched with the script in this post as Googlebot and as Chrome, plus the same probe run against four sitemap URLs on umesh-malik.com, December 4, 2026.
Frequently asked questions
Google Search · Preferred sources
Prefer this site on Google
If you already read this writing, add umesh-malik.com as a Preferred Source. Google can then highlight it with a preferred badge in Top Stories, AI Overviews, and AI Mode — for you, not as a site-wide ranking boost.
Related Articles

Web Engineering
Fix Sitemap URL Not Allowed in Search Console: 11 Cases Tested
Sitemap URL not allowed means a <loc> sits outside the sitemap's host, protocol, port or folder. I ran 11 setups through a checker: 6 fail, 1 needs robots.txt.

Web Engineering
Fix Sitemap Contains URLs Which Are Blocked by Robots.txt: 4 Causes
Sitemap contains URLs which are blocked by robots.txt means your two files disagree. Find the Disallow rule behind each URL, then decide which file is wrong.

Web Engineering
Fix Sitemap Couldn't Fetch in Search Console: Test First, Then Wait
Fix Sitemap couldn't fetch with one live URL test. If Googlebot gets a 200, the file is fine and Google deferred it. If not, a free script finds why.
Keep reading
Get new posts on AI, Claude Code & LLMs
New deep-dives on AI engineering, Claude Code, and developer tooling — follow along however you prefer.
About the Author
Software engineer writing about AI, Claude Code, LLMs, OpenAI, Anthropic, and developer tooling. 5+ years building production systems at Expedia Group, Tekion, and BYJU'S.