XML Parsing Error: XML or text declaration not at start of entity in wordpress XML Parsing Error: XML or text declaration not at start of entity in wordpress wordpress wordpress

XML Parsing Error: XML or text declaration not at start of entity in wordpress


Check your themes functions.php file and other plugins for trailing whitespace (or opening whitespace) outside of the tags. I think something is outputting whitespace before the SEO plugin has a chance to display the sitemap and that is the most likely cause.


if it's happened on WordPress, you need to edit your functions file and remove whitespace (or opening whitespace) outside of the tags at the start and end and save the fileproblem resolved 😎👍


I had this problem as well when I wanted to use the SEO plugin sitemap.It is more commonly happens in functions.php:

  1. Go to your active theme functions.php.
  2. in the end, delete ?>
  3. backspace till you reach the code.