Fix the sitemap format on WordPress
Why it matters
The sitemap file cannot be read as a valid sitemap, so search engines will ignore it. The usual causes are an html page returned instead of the file, broken xml, or a wrong encoding.
The fix
- A common cause is a PHP notice or stray whitespace printed before the xml by a plugin or theme. Turn off WP_DEBUG_DISPLAY and look in the plugin or theme for text printed outside functions.
- Deactivate sitemap and SEO plugins one at a time to find the one that breaks the output, and use only one sitemap source.
Related
- Reported by the robots.txt and sitemap check
- Add a robots.txt file
- Fix the server error on robots.txt
- Fix the syntax of robots.txt
- Shrink the robots.txt file
- Allow search engines in robots.txt
- Publish an XML sitemap
- List the sitemap in robots.txt
- Make the sitemap reachable
- Put URLs into the sitemap
- Split the sitemap into several files
- Remove URLs from other domains in the sitemap
Scan your domain to see whether this applies to you.