The Yoast SEO XML Sitemap not working is a common occurrence that can wreak havoc on your WordPress blog. If you see the following message the fix is rather simple.
XML Parsing Error: XML or text declaration not at start of entity
Line Number 3, Column 1:
This is not one of those crazy plugin conflicts that require you to deactivate and troubleshoot. Instead this is a white space issue in one of the following WordPress files: wp-config.php or your theme’s functions.php.
Remove White Space From Files
To correct the Yoast SEO XML Sitemap not working issue check both of those files for white space at the top (usually before the <?php) or near the end of the file. WordPress has now included line numbers, so ultimately make sure you have no blanks lines at the beginning and end of these files.
Disable and Re-enable the Sitemap
If you find and remove white space, and the issue persists, try disabling the sitemap functionality within the plugin settings, clear your cache, and re-enable the sitemap.
Troubleshoot WordPress Plugins
Finally, if you have no success, you may need to start troubleshooting by deactivating plugins. In some occurrences plugins have been known to add white space to different areas of dynamic files, such as the index_sitemap.xml file.
We hope this blog post helps you alleviate your issue! More information can be found here.