Header Already Sent Error – How To Fix It!

One of the most nagging and irritating problem being reported by many bloggers is the “Warning: Cannot modify header information – headers already sent by (output started at path/)” error.

This happens for a number of reasons and the major cause of this problem is blank spaces/lines within a specific file as indicated by the warning.

Lets have a look at an example:

Warning: Cannot modify header information – headers already sent by (output started at path/wp-includes/classes.php:1597) in path/wp-includes/pluggable.php on line 865

As we can see from this error the warning is telling us that the problem is in the classes.php @ line 1597 and its having an effect on the pluggable.php on line 865

This can be easily remedied since the warning has already told us what the problem is and which file is being affected. So now what we need to do is inspect the error location, in this case its line 1597 of the classes.php.

How to fix the problem:

Download the file to your desktop and open it with an editor that has numbering, I use the PHP Editor (You can get a free copy here). – Now locate the line in question and take a look at it, its always good to have a copy of the original file for comparison.

In this case the problem is right at the end of the file where line 1597 has nothing in it. This tells us that it’s the classic “blank” spaces/line issue and all you have to do is delete it and save the file. The best way to do this is to place the cursor on the last > located after the ? mark, it looks like this ?> and delete it, hold down the delete key for about 10 seconds. Release the delete key and add the > back, now do nothing else other than saving the file.

Re-upload to your server, reload your web page and hopefully that should have fixed the problem and your site should be back up and running.

If you find this post helpful please tell others, if I’ve got it wrong please tell me – leave a comment.

If you have a specific problem and want it looked into,send me an email via the contact us form.

24 comments

  1. sandiegoweddingdj
  2. admin

Trackback e pingback

  1. dostanamehfil
    RT @bloginstaller Header Already Sent Error – How To Fix It! | Wordpress Blog Installation Service! http://bit.ly/HBoqL
  2. Zulfikar Nore
    RT @BlogInstaller Header Already Sent Error – How To Fix It! | Wordpress Blog Installation Service! http://retwt.me/1KxeZ
  3. Riddhi Mohan
    RT @BlogInstaller Header Already Sent Error – How To Fix It! | Wordpress Blog Installation Service! http://retwt.me/1KxeZ