I had no problem viewing my RSS feed when I was developing locally, but once I copied all the files to my webserver I was getting this error. When I viewed source of my /feed/ URL, I could see there was a line break before the XML declaration at the top of the file.
Since the exact same files were working on my localhost installation, I knew it wasn’t due to any plugins or trailing whitespace at the end of any of my files because that would have caused an issue on my local copy as well.
Somehow I was able to fix the problem by opening wp-includes/feed-rss2.php, making a change in the file, saving it, uploading it, undoing the change (so it was exactly the same as before), and then uploading again. No clue why that fixed it, but it did.. there’s no longer a blank line being output at the beginning of the XML file.
HTH someone..
Hi folk,
This problem occurs because of the leading space before xml content.
I faced the same problem and then i found the solution at
http://www.w3it.org/blog/wordpress-feed-error-output-solution-how-to/
And it works pretty well for me.
Hope, it could be helpful to someone!!!!!!!!
Regards,
http://www.google.com/profiles/sachinpethani
Hello
I have this problem on http://www.thewhatwherewhen.org
I have gone through my files and can not see the line
I have done this
http://www.w3it.org/blog/wordpress-feed-error-output-solution-how-to/
and this
http://wejn.org/stuff/wejnswpwhitespacefix.php.html
I have disabled all my plugins and still have this problem
Can anyone help?
Thanks
[letsnurture]: Thank you very much for this solution of broken RSS feed, it works, it’s simple and it take much shorter time then looking everywhere in core/templates files… I’d say 5 minutes? 🙂
Hello,
I am facing the same problem on my site http://www.iplt20livecricketscorescard.com
I have checked all the php files in my theme as well as wordpress root files and removed all the white spaces & blanks
But still no success.
Please help.
Thanks
the solution mentioned in the above link http://www.w3it.org/blog/wordpress-feed-error-output-solution-how-to/ worked for me.
I added following code to wp-includes/feed-rss2.php and it worked
$out = ob_get_contents();
$out = str_replace(array(“\n”, “\r”, “\t”, ” “), “”, $input);
ob_end_clean();
However when first I applied the above code it did not work, then I realized that ‘WP Super Cache’ may be showing the same page again, I deleted all the cached pages and it started working.
thank you all.
This solution work
http://www.w3it.org/blog/wordpress-feed-error-output-solution-how-to/
But it cause few problem in my site, first my index was completely broken. Then still none of my feedburner feed updated, i pinged few times, still same old post.
I had the same problem on my site and this post helped. I just searched for how to remove spaces in front of <?xml. The solution that worked for me was to check my PHP files for spaces or other unseen characters before the first <?php tag in every file included / required to render the page producing the error. According to the advice I found, this is a known issue with PHP and also goes for any characters after the last ?> tag. (Including “\n” – line feed character). I hope this helps someone speed up their fault find.