Sitemap Error: XML or text declaration not at start of entity
When you get an error like “XML or text declaration not at start of entity”, “XML declaration allowed only at the start of the document” or similar, check the source of your XML sitemap. Usually, there will be several lines of whitespace preceding the
<?xml tag. If this is the case… Start searching. Something in your WordPress install, either a plugin or your theme is outputting whitespace, and it shouldn’t… It’s not a bug in our plugin.
If you don’t know how to see whether this is the case with you, please view the source code of your sitemap following the steps here.