WordPress Error: Headers Already Sent

Posted on Tuesday, June 16th, 2009 at 12:24 pm in

I keep getting the following error message:

Warning: Cannot modify header information - headers already sent by (output started at /home/nnnnnnn/public_html/xxxxxx/wp-settings.php:1) in /home/nnnnnnn/public_html/xxxxxx/wp-includes/pluggable.php on line 850.

The root cause is probably a space or blank line before an opening <?php tag or after a closing ?> tag in one of your WordPress files.

The wp-config.php file is the most common culprit but check the error message carefully as it may indicate the name of the file where the error occurred. In the example listed above, the faulty file is most likely the one mentioned in the line output started at — in other words, wp-settings.php.

Ideally you should replace the faulty file with a fresh copy from a recent backup or one from a fresh WordPress download. If you don’t have a recent backup and this is a custom file:

  1. Download a copy of the file mentioned in the error message.
  2. Open that file in a plain text editor (Notepad or similar).
  3. Check that the very first characters are <?php
  4. Check that the very last characters are ?>
  5. Place the cursor between the ? and >.
  6. Press and hold the DELETE key for 10 seconds.
  7. Type >.
  8. Save without pressing any other key.
  9. Upload the edited file.
You might also be interested in

WordPress Installation and Set Up

Top