Tech Blog

Fix error: Blank line before XML declaration in Wordpress RSS

by Rolando on Apr.20, 2009, under wordpress

If you check your RSS feed and find this error have fun digging through php files until you find the one(s) with the problem.  Basically you need to find php files that end with blank line after the php closing tag ?>

First make sure you get the blank line error when validating your RSS feed at http://validator.w3.org/feed/

In my case I had two blank lines at the beginning of the RSS feed and found the problem on these two files:

  • /wp-settings.php (in the root)
  • /wp-includes/functions.php

Is this doesn’t fix it, try these other files as explained in the W3C website (http://validator.w3.org/feed/docs/error/WPBlankLine.html)

  • /wp-config.php
  • functions.php inside your themes directory
  • wp-rss2.php
  • wp-atom.php

If you get the error still, start disabling your plugins one by one until the error goes away.

Hope this helps. Good luck!


Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...