Are you getting this error when viewing the XML sitemap you created using Yoast’s excellent SEO plugin on WordPress?
I had a client with the same issue but digging around I found a few solutions which you can try as provided by feedvalidator.org:
If an XML declaration () appears in your feed, it must be the first thing in the feed, before any whitespace.
Unfortunately, with WordPress it seems all too easy for a plugin, a theme, or for your configuration file to contain a blank line. Further compounding this problem, some — but not all — feed readers compensate for this common error, allowing the error to go undetected for quite a while.
- PHP also uses a similar notation: . Note that the final php ?> should be omitted from all PHP code files—modules, includes, etc. The closing delimiter is optional in PHP (but not in XML), and removing it helps prevent unwanted white space at the end of files which can cause problems with your feeds.
- Check your wp-rss2.php and wp-atom.php files for blank lines outside of <? and ?> bracketed sections.
- Check your wp-config.php file for blank lines outside of <? and ?> bracketed sections.
- Check your theme’s functions.php file for blank lines outside of <? and ?> bracketed sections.
- One by one, disable plugins and revalidate until you isolate the one causing the problem.
For my client, solution 4 resolved the problem. By removing the one line of blank space in the functions.php file, the XML feed worked again.