// wordpress & cpanel how-tos
Fixing "Your Sitemap appears to be an HTML page" in Google Search Console
You created a sitemap, submitted it to Google Search Console, and got this error: "Your Sitemap appears to be an HTML page. Please use a supported sitemap format instead." Here's what it means and how to fix it.
What the error means
Google expects an XML file at your sitemap address, but Googlebot finds an HTML page instead. Before you change anything, open your sitemap URL and test it with an XML sitemap validator. In most cases the result is an invalid XML format, and the cause is one of the two problems below.
Fix 1: Stop caching your XML sitemap
WordPress caching plugins create a cached copy of your sitemap, and some add optimizations like minifying it. That cached copy can be broken. The fix is to exclude the sitemap from the cache, then clear the whole cache. Popular plugins all have an option for this:
- W3 Total Cache: go to Performance → Page Cache, scroll to "Never cache the following pages" and add your sitemap.
- WP Rocket: go to Settings → WP Rocket → Advanced Rules and add the sitemap URL to "Never Cache URL(s)".
- WP Super Cache, Hyper Cache and others: look for "rejected URLs" or "exclude pages" in the plugin settings.
Which address to add depends on your sitemap plugin: sitemap_index.xml for Yoast SEO, and sitemap.xml for most others. If you have separate sitemaps for videos, images or authors, add them too. Save, clear the WordPress cache, and purge your CDN if you use one.
You could also create a cache rule for Googlebot only, but that isn't guaranteed to work. I prefer to disable caching on the sitemap and avoid the errors in Search Console.
Fix 2: Use the default stylesheet
Some sitemap plugins use a stylesheet to make the sitemap readable in a browser. If that option was turned off by mistake, your browser shows a page of raw lines with the warning "This XML file does not appear to have any style information associated with it".
In the XML Sitemap Generator for Google plugin, go to Settings → XML-Sitemap, find the stylesheet option under Basic Options, choose to use the default, and click Update Options. Clear your browser cache and your WordPress cache, then test the sitemap again. If you use a different plugin, look for its stylesheet setting or ask its support.
Why a valid sitemap matters
These solutions work for most WordPress sites, but server settings and other plugins can cause the problem too, so check with your host if it continues. A valid XML sitemap is one of the best ways to help Google, Bing and other search engines crawl your site. Without it, Googlebot may miss some of your posts and pages.
FAQ
Why does Google say my sitemap is an HTML page?
Because Googlebot received HTML instead of XML at your sitemap address. The most common cause is a caching plugin serving a cached or minified copy of the sitemap, or a redirect that sends Googlebot to a normal page.
Should I exclude the sitemap from my caching plugin?
Yes. Your sitemap is small and changes whenever you publish, so caching it gives little benefit and can break it. Add it to your caching plugin's "never cache" list, then clear the cache.