skip to Main Content

I face a error problem, i used WordPress SEO plugin, when i enable xml site map and visit my sitemaps list http://localhost/sitemap_index.xml then show this error
see screenshot http://prntscr.com/8ffuph

I have already tried lot of tips in WordPress directory and stackoverflow
but I’m not successfully, because I’m beginner level in PHP. please help me.

4

Answers


  1. 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.

    Login or Signup to reply.
  2. 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 file
    problem resolved 😎👍

    Login or Signup to reply.
  3. 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.
    Login or Signup to reply.
  4. Instead of examining and fixing all your plugins manually, which can be cumbersome if you have a lot of them installed, you can try if this plugin does the trick:

    https://github.com/xemlock/wordpress-seo-sitemap-fix

    I wrote it a while ago for this exact purpose – to overcome this tiny, but annoying, implementation flaw of the WordPress SEO plugin.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search