What Causes A “Cannot modify header information – headers already sent by” Error?
Cannot modify header information errors are most commonly caused by extra white space in a PHP file, or by other files sending header information already. It’s usually added on accident when editing and modifying WordPress files. A single extra space can prompt this error. However, it’s also possible that you installed a plugin containing files that have an extra space, causing WP to throw this error up.
It will look something like this:
Warning: Cannot modify header information – Header already sent by (Output started at /blog/wp-config.php:31)
How to Fix “Cannot modify header information…” Errors
In order to fix the error, you have to first find out where it’s coming from. The error you see on the page will usually tell you where to look. In the example above, it’s in the wp-config file on line 31.
Step 1: Go to the file and line number it identifies to see if there are any extra spaces
Step 2: Make sure there are are no spaces before
<?php at the beginning of the file
Step 3: Make sure there are no spaces after
?> At the bottom (If there is one, there does not have to be
?> at the end)
Step 4: Make sure there are no extra blank spaces at the end of the code, period
If you can’t find any extra spaces anywhere, it may be a plugin. Disable all your plugins and see if the error is gone. If so, turn them on one by one, checking after each one, to find the problem-causing plugin.