“Cannot Modify Header Information” : A WordPress Error To Solve.

cannot modify header information

When you run a WordPress website then most of the time it is possible that you can see some WordPress errors. Have you ever got “cannot modify header information” error? This is not one of the common errors in WordPress but still, when it appears, people freak out.

It’s obvious that when you see any type of the error in your WordPress admin panel or on your website then you fret. The internal server error, HTTP error, and many other WordPress errors are there which are common.

Why Do You Get “Cannot Modify Header Information -Header Already Sent By” Error?

When you see this error then the path of the file would be seen. You would know the error generation source. It may occur due to any extra space in the PHP code of that file.

It is possible that one of your plugins is creating the problem. In my case, a plugin was generating this error. This error may appear during following actions:

1. When you publish your blog post.

2. When you update your blog post.

3. When you try to install any new plugin.

4. When you deactivate any existing plugin.

It means that whenever you take any action which will modify the information of that particular file then you will get “cannot modify header information” error.

cannot modify header information - headers already sent by

You may be thinking as the error appears in the response of every action you take from the WordPress area. This error may appear everytime to do something new.

It can cause the login problem and you won’t be able to login to your WordPress admin panel.

How To Fix “cannot modify header information error” ?

There are basically three things you can do to fix this error.

1. Re-install the WordPress from the WordPress dashboard. It would fix a lot of bugs of the corrupted files. If that works then great otherwise, you have to follow some more steps.

2. Replace the WordPress file using the cPanel of your web hosting account. In the error, you would notice the path of the file from which an error has been generated.

If the file is not from the core files of the WordPress then you can replace it with a new file. WordPress has many default files which can be replaced with a new file. Download the same version of WordPress and replace the file.

3. Download the file and find the white space in the code. In the “cannot modify header information” error, you will see the line number. You can download that file on your computer and then check the white space in that line.

If you find something wrong then remove that and re-install the file in the WordPress directory. You can also do that using the FTP account.

4. Deactivate all the plugins and then activate each of them. If the plugin is the culprit then you would find it in this process. Make sure that you check the generation of the error after activating each and every plugin.

Don’t just activate two or three plugins at once. It would be hard to find the real culprit.

Can You Now Solve “cannot modify header information error” ?

There may be any reason. You have to find it out. This WordPress error is unique and most of the people haven’t noticed it on their website. But if do then now you know the reasons and the solutions.

In most of the cases, the plugin has the main role in the error showing. That’s why it is always recommended that you should choose a WordPress plugin after checking all the things including the ratings, reviews etc.

Are you thinking about any other error of WordPress? You have to take care of your website by removing such errors.

by Ravi Chahar

A WordPress Professional and a LinkedIn influencer. A coder by passion and a blogger by choice. WordPress theme development is what he can rock with. He is your WordPress guy who will teach you how to solve WordPress errors, WordPress security issues, theme development, design issues and what not.

Leave a Reply

Your email address will not be published. Required fields are marked *