Make Money Online Queries? Struggling To Get Traffic To Your Blog? Sign Up On (HBB) Forum Now!

WordPress Error – Headers Already Sent Warning Problem


Yesterday I almost became tensed. Some tutorials on the net are really lame! ๐Ÿ˜› 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


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?


CEO and Founder of Slashsquare, Indian Blog Network and Web Consulting Media. HBB is a part of Slashsquare Network. I'm a Tech Blogger, Striving Entrepreneur, Atheist, and Proud Indian. Catch me on Facebook and Twitter.

  • My Website

Want to discuss your queries and interact with experts? You can connect with HellBound Bloggers (HBB) Facebook group for free!

Join HellBound Bloggers (HBB) and get Instant Updates. We'll also notify you with Great Deals, Discounts and other Interesting Tips. We won't SPAM or SHARE your Email Address with anyone.

Thank you for reading! We welcome and appreciate your comments, but at the same time, make sure you are adding something valuable to this article. If you have any serious queries, suggestions or anything related to this article, feel free to share them, we really appreciate that.

But, if your blog comments are a random "Thank you", "Useful Post", or anything that doesn't actually upscale the article, then we'll be removing them and it won't be appeared below. Thanks for understanding and thanks for connecting with us. If you want to give us any feedback or report any errors, you can kindly contact us and we'll revert back soon.

  • Comments
  • Facebook Comments
  • Comments

    Leave a Reply

    Your email address will not be published.

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


    • wparena

      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

    • ksvarma

      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.

    • Debbie

      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.

    • Xpress Music

      recently i had feed errors

    • Suneel

      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.

    • Domain name registration

      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.

    • Sourish Nath

      these things happen in WP , thats why im on blogger now , with low seo space

    • Uttoran Sen

      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 ๐Ÿ˜›

      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.

    • Android App Developer

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

      Glad that it is fine now.

      Nice tut BTW.

    • mra

      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.

    • Ajith Edassery

      I have faced this weird problem while I was developing my theme. It got solved by re-arranging the header content then.

      • Ajith Edassery@Make money online

        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.

    • Simrandeep Singh

      I too faced this problem when I was designing wordpress theme and I solved the problem by removing white spaces only.

    • chandan

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

    • Robin

      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.


      – Robin

    • Dennis Edell | Direct Sales Marketing

      I've faced it and had no clue, thanks man!

    • Blogger Templates

      Sometimes small mistake in code can be fatal.We should always backup theme before editing it otherwise we can get into trouble.

    • Narendran.M

      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??

    • sidduz

      I’ve got this problem, but I have replaced the core files… This tutorial makes it easy. Thanks

    • Tech Sputter

      cool article mate!!!!
      Its good that you are posting these sort of articles related to wordpress these are really usefull ๐Ÿ™‚ ๐Ÿ™‚

  • Facebook Comments