WordPress Error – Headers Already Sent Warning Problem

Written by in WordPress - Print This Post



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?









HBB RSS
Hello there! If you are new here, you might want to subscribe to the RSS feed for updates on this topic. You will also get instant access to 100+ HBB Guides & Tutorials.
If you wish to subscribe here via Email, then kindly click here.



Editor-in-Chief and Owner of 20 Years Old Kiddo, Open Source Enthusiast, Tech Blogger, Striving Entrepreneur, and a Typical Engineering Student. Addicted to Blogging, Walking and Messing. Catch him on Facebook, Twitter and .


HBB has 670+ Awesome Contributors. [Join HBB].

HellBound Bloggers (HBB) is a part of Slashsquare Network.






21 Responses to “WordPress Error – Headers Already Sent Warning Problem”

Leave a Reply


Comments Policy | Brand Your Comments | Do Follow Blog | Top Commentators Award


REFERENCE : 7 Tips To Be A Hero On Blog Commenting [HELPFUL]


Overall HellBound Bloggers (HBB) has 23,622 Genuine Comments and Yours Will Add More Value To It.




Previous Article:

Next Article:

  1. Narendran.M says:

    Nice work mate!! I’ll seek your help if I overcome any WordPress error like this, ;) ..

    Before that, I think you did some editing work in your WP, May i know what you did?? & Why you got this error??

  2. Tech Sputter says:

    cool article mate!!!!
    Its good that you are posting these sort of articles related to wordpress these are really usefull :-) :-)
    .-= Tech Sputter's last blog…AlertThingy- Your Social Desktop App… =-.

  3. sidduz says:

    I’ve got this problem, but I have replaced the core files… This tutorial makes it easy. Thanks
    .-= sidduz’s last blog…Things To be considered Before buying a New Mobile Phone =-.

  4. Sometimes small mistake in code can be fatal.We should always backup theme before editing it otherwise we can get into trouble.
    .-= Blogger Templates’s last blog…Add Popular Posts Widget to Blogger =-.

  5. I've faced it and had no clue, thanks man!
    .-= Dennis Edell | Direct Sales Marketing's last blog…It’s His FIRST Comment Contest! =-.

  6. Robin says:

    So far no, but i am sure this will help me in future when i face such errors. Seeking for valid source of problem solving is highly recommended.

    Cheers.

    - Robin
    .-= Robin’s last blog…Performance Comparison Chart of Web Browsers =-.

  7. chandan says:

    Well I have not see such type of error on my blog till now. If I get any problem I will discuss with you.

  8. I too faced this problem when I was designing wordpress theme and I solved the problem by removing white spaces only.
    .-= Simrandeep Singh’s last blog…Nokia’s First Linux Maemo OS Based Mobile Phone N900 Launched In India =-.

  9. I have faced this weird problem while I was developing my theme. It got solved by re-arranging the header content then.
    .-= Ajith Edassery’s last blog…MaxBlogPress Ninja Affiliate Plugin Review & $30 Discount Coupon =-.

    • Haha… Man, how many times you don’t get this problem? Today, while installing a new plugin, I got into a little bit adventurous mode and started editing without a backup on notepad. Finally it turned out that the crappy notepad put some extra characters before the open php tag. It wasn’t visible in UTF encoding but when I switched to unicode, those little monsters appeared.. Very useful post man.

  10. mra says:

    Nice post and fantastic job done.First time came to know so many errors code and meaning. How to take care of them ill be easy if you understand them.Back up your thing always safe than lost.Thanks for knowledge sharing specially for those who are using wordpress stuffs.

  11. Pradeep I have seen your site behaving abnormally when you were making the change.

    Glad that it is fine now.

    Nice tut BTW.

  12. Uttoran Sen says:

    Yep, i learned this the hard way as well, now i always try upgrade, experiements and sometimes even new plugins on my smaller and less important blogs. Messing up the main blog give a heart attack sort of a feeling :P

    i had faced a similar problem, thanks to my exceptional coding talent, i never bothered/dared to do more editing, i uploaded the file from the backup and things were all right.
    .-= Uttoran Sen’s last blog…Summers are on – Where is Uttoran Sen? =-.

  13. Xpress Music says:

    these things happen in WP , thats why im on blogger now , with low seo space
    .-= Xpress Music’s last blog…Nokia 5233 Xpress Music Phone Specifications =-.

  14. Nice tips, I have not seen this type of error message on my blog, thanks for sharing the solution, I now know the error and how to resolved it, if such error occur in my blog.

  15. Never faced such an issue.
    .-= Anish K.S @ Technics Today.com’s last blog…123Greetings.com launches ‘Connect’ =-.

  16. Suneel says:

    This is one of the most common problems which I faced when I was updating or tweaking my blog. All the times, I used to deactivate the newly being used plugin and try to refresh the page which used to work perfectly.

    This is a minute thing which I missed and you have covered very well in this post.
    .-= Suneel’s last blog…AT&T Trying to Enter Indian Telecom Market With Reliance Communications =-.

  17. Xpress Music says:

    recently i had feed errors

  18. Debbie says:

    Great post. Just received this error for the first time and couldn’t figure out why. I had copied some code to a functions.php file from another tutorial and it must have included some hidden spaces. Thanks for helping me fix it.

  19. ksvarma says:

    Wow, Thank you very much. I got the same problem but in pluggable.php file. But which ever the file is the solution is exactly what you said. Its only the empty lines at end of the file.

  20. wparena says:

    Thanks Kumar! I’ve been getting those errors in a couple of little websites. Now I know what the heck is going on and have written on it also



Subscribe without commenting




COPYRIGHT © 2012 SLASHSQUARE NETWORK. REPRODUCTION WITHOUT EXPLICIT PERMISSION IS PROHIBITED. ALL RIGHTS RESERVED.

Slashsquare
Mobile Version · About Us · Contact Us · Subscription · Advertise · Review · Write For Us · Archives · Privacy Policy · Disclaimer
Loading...
ViperBarUp
ViperBarDown