WordPress Error – Headers Already Sent Warning Problem

Yesterday I almost became tensed. Some tutorials on the net are really lame! :P I trusted a site and applied that tutorial directly on my blog, and the result became sh*t. I highly recommend you to try tutorials on a demo blog rather than on your primary site or blog.

Yesterday I came across this unique WordPress error titled “Cannot modify header information – headers already sent by …” [Without Quotes]

Though, this tutorial is 99.9% perfect, I recommend you to backup all your theme files before implementing this tutorial. Happy Blogging!

I’ll tell you what mistake I did and how to resolve that.. 8)

Description :

You get a warning message on your browser that says:

Warning: Cannot modify header information – headers already sent by (output started at

Example :

Warning: Cannot modify header information – headers already sent by (output started at //home/htdocs/wordpress/wp-config.php:1) in /home/htdocs/wordpress/wp-login.php on line 12

WP-Error-close

Reason :

The reason is simply simple. It is usually because there are spaces, new lines, or other garbage before an opening < ?php tag or after a closing ?> tag, most probably in wp-config.php. It may also occur in other files too, so please check the error message. Many editors are adding additional blanks (spaces) and empty lines at the end of a file when you edit it.

Solution :

The best solution I would say is to replace the corrupted file with the file you have in your backup. You can also try the following alternative steps!

#1 - Download the file mentioned in the error message.

#2 - Now open that file using a really good Text Editor. It should be a plain text editor. I highly recommend Notepad++ or TextWrangler.

P.S. Don’t risk. Avoid Notepad, WordPad and even MS Word.

#3 – Now check that the very first characters are < ?php and the very last characters are ?>

Most Important!

You should save your file either as ANSI/ISO-8859 or as Unicode without BOM. Don’t ever save in normal format.

Have you ever faced this problem? Do you any other solution for solving this?

5th Jun 10. Posted in WordPress.

View or Post Comments.