Help! Headers Already Sent Problem


Description: You receive a warning message on your browser that says something like:

Warning: Cannot modify header information – headers already sent by

Why is this happening? According to wordpress codex, this happens when there are spaces, new lines, or other garbage before an opening or after a closing php tag, which usually in wp-config.php.

How to solve it? Open the wp-config.php using notepad or BBedit or any plain text editor. You can also use code editor like dreamweaver and other similar software.

Go to the first character or the first line of the code. Make sure that there are no spaces BEFORE the first character <. Otherwise, delete the empty spaces using “backspace” or “Delete” from your keyboard. Also make sure that there are no spaces between the opening tags <, ? and php.

Now go to the last character or last line of code. Make sure that there are no empty spaces AFTER the last character >. Otherwise, (again) delete the empty spaces using “backspace” or “Delete” from your keyboard. Also make sure that there are no spaces between the closing tags ? and >.

It is still not working? I also encountered this problem. If editing the wp-config.php does not work. Open your function.php and do the same solution as above.

Further Troubleshooting. If all of the solutions still does not work. Determine which file is having the error. For example it says:

Warning: Cannot modify header information – headers already sent by (output started at /path/wp-admin/admin-header.php:8) in /path/wp-admin/post.php on line 569. Then it clearly states that there is some problem on admin-header.php in line #8 which affects the line #569 of post.php. Therefore, I suggest you open the admin-header.php and check for some whitespaces or other garbages and do the same solution mentioned above.

Advertisements

About freelance webmasters

We a re a group of webmasters designing professional facebook pages, twitter, youtube and wordpress sites at affordable prices. View all posts by freelance webmasters

3 responses to “Help! Headers Already Sent Problem

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: