/ Wordpress

Fixing RSS Feed In Wordpress

RSS Search

I have unfortunately had to deal with a great deal of Worpress fuck ups, the most recent being the RSS feed of a site having a blank line injected at the top of the XML document.

I went through every PHP file hunting down white space that could lead to this occurance and I was utterly unsuccesful.

Then hope arrived. A throwback command to make all this pain so simple to remedy. If you seeing this message when accessing yoursite.com/feed

There is a very simple solution that will recursively find and delete trailing white space in all of your PHP files within your theme directory. Here is what you do:

In a terminal via ssh or locally:

cd ~/yoursite/wp-content/themes/yourtheme

then run:

find ./ -name "*.php" -exec sed -i -e '/^\n*$/d' {} \;

You should now be able to navigate to yoursite.com/feed without any problems :)

Let me know if that doesn't work.