3

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 4

4

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.

Sign up to request clarification or add additional context in comments.

Comments

3

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 😎👍

Comments

3

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.

Comments

2

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.