"Sitemap is HTML": the URL you submitted returns a web page, not XML
The "Sitemap is HTML" error means the address you gave Google answered with an ordinary web page where XML was expected. Usually the submitted URL is wrong, such as a visitor-facing sitemap page, or WordPress is returning the homepage, a login screen or an error page at the sitemap address.
Google accepts sitemaps as XML, RSS or Atom feeds, or a plain text list of URLs. An HTML page with links on it is not one of those formats, however useful it is to people.
Check what the URL really returns
A browser is a poor judge here, because many XML sitemaps are styled with an XSL stylesheet and look like a tidy HTML table. Use the response headers and the first bytes of the body:
curl -sI https://example.com/sitemap.xml | grep -i content-type
curl -s https://example.com/sitemap.xml | head -c 300
The content type should be application/xml or text/xml, not text/html.
A real sitemap starts with <?xml version="1.0" followed by a <urlset> or <sitemapindex> element. If you see <!DOCTYPE html>, the error is accurate.
The free SEO audit performs a version of this check: it reads the Sitemap: lines in your robots.txt and reports "is not a valid XML sitemap" when one of them points at a document that is not a <urlset> or <sitemapindex>.
Cause 1: you submitted the page for humans
An HTML sitemap is a normal page listing your content for visitors, often at /sitemap/. An XML sitemap is a file for crawlers, usually at /sitemap.xml. They are different things with similar names; our post on HTML sitemaps versus XML sitemaps explains what each is for. If the URL in Search Console ends in a slash or has no .xml, this is probably what happened. Remove the entry and submit the XML address. With Hydrogen SEO, the address is shown on Hydrogen SEO → Sitemap.
Cause 2: WordPress answers with a different page
The homepage. With permalinks set to Plain, WordPress has no rewrite rules and an unknown path can fall through to the front page. Choose any other structure under Settings → Permalinks.
A redirect to the homepage. Some "redirect all 404s to home" features catch the sitemap address when its rewrite rule is missing. The request ends on the homepage with a 200. Re-save permalinks to restore the rule and turn off blanket 404 redirects, which cause soft 404s in any case.
A maintenance or coming-soon screen. These plugins replace every front-end response, including /sitemap.xml, for logged-out visitors. You see XML because you are logged in; Google sees the holding page. Test in a private window.
A login wall or bot challenge. Membership plugins that force login site-wide, and CDN challenges, return HTML to anonymous requests.
A cached wrong response. If a page cache stored HTML for the sitemap URL during one of the above, it keeps serving it. Exclude sitemap paths from page caching and purge.
Cause 3: the sitemap moved
After switching SEO plugins the sitemap address often changes, for example from /sitemap_index.xml to /sitemap.xml or from /wp-sitemap.xml to a plugin URL. The old address may now show a 404 page or redirect somewhere unhelpful. Remove old entries from the Sitemaps report and update any Sitemap: line that was hard-coded in a physical robots.txt file. Hydrogen SEO adds the line for its own sitemap automatically and redirects /wp-sitemap.xml to its index, so the WordPress core address keeps working.
Fix, resubmit, confirm
- Make the correct URL return XML to a logged-out request, using the curl checks above.
- Paste the XML into the XML sitemap validator to confirm it is well formed and within the protocol limits.
- In Search Console, remove the failing sitemap entry and submit the correct URL.
- Check that robots.txt lists the same URL on its
Sitemap:line.
The report should change to "Success" and show a count of discovered pages after Google's next read. The step-by-step submission process is in our guide to submitting a sitemap to Google.
Common questions
My sitemap looks like a formatted table in the browser. Is that HTML?
Not necessarily. Sitemaps with an XSL stylesheet render as a table but are still XML. View the page source or check the content-type header to be sure.
Can I submit my HTML sitemap page to Google at all?
Not in the Sitemaps report. It is a normal page, discovered and crawled like any other. It helps visitors and gives crawlers links to follow, but it is not a substitute for the XML file.
Does this error affect pages that are already indexed?
No. It only means Google is not getting a URL list from that address.
Why did this start after I enabled a coming-soon mode?
Coming-soon and maintenance modes intercept every request from logged-out visitors, including the sitemap. Disable the mode or exclude the sitemap path.