I have a frustrating problem. In the page source, the first line is blank, which causes issues in some browsers.

These are the steps I've taken to try to fix the problem:

  • Gone back to twentythirteen theme
  • renamed plugins folder to oldplugins. Checked in admin and they are all deactivated
  • Made sure there is nothing outside of the php in index.php, header.php
  • cleared out htdoc htaccess

I'm at a loss!

  • Did you compare all WordPress files to a fresh download if anything differs? – kraftner Feb 20 '14 at 12:03
  • There's a file called sunrise.php in wp-content. That had an empty line after the closing php so I thought removing that would solve it. It didn't. Interestingly, I put '123' directly after the closing php and that shows up on line 1 of the source, instead of the blank line. – Chris Feb 20 '14 at 12:18
  • 2
    Found it! there was a blank line in wp-config :) – Chris Feb 20 '14 at 12:20

In this instance, there was a carriage return after the closing php tag in wp-config.

  • 2
    You don't need to close php tags. What WordPress version are you using? wp-config.php does not have a closing tag by default. – RRikesh Feb 20 '14 at 13:06
  • 3.8.1. It's probably me that has put one in by mistake in the past, including the offending blank line. Its a learning curve ;) – Chris Feb 20 '14 at 13:13

I know this has already been answered, but in case anyone else runs into it: if there is a ?>\n in any of the included files of the theme's functions.php or in functions.php itself at the very bottom, that can cause it as well.


Great current answers, but worth noting: My extra line breaks were hidden away in /wp-content/mu-plugins/custom-post-types.php where I had setup some Custom Post Types. Once I deleted all characters after the closing ?> and refreshed the front-end, everything works great!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.