0

When I visit sitemap.xml of my WordPress website I see this error. Here is the imageenter image description here

0

This is probably due to empty lines inside your custom php files. Try checking every php file you edited for empty lines after the ?> closing tag: the tag should be the last character of any file.

0

I look for empty lines inside every PHP files but I didn't find any but at last, I found the solution the error was due to a function which I declare in my functions.php file, the function was register_sidebar(); but I was not using it in my theme anywhere. When I removed this function in my functions.php file then sitemap.xml of my website working correctlyenter image description here

  • so if you have the same issue you should also check your functions.php file may be the error is due to any function you declare in your theme's functions.php file. – Khalil Mar 15 '19 at 13:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.