Cannot modify header information WP Error


So I encountered this error while updating a client’s WordPress site based on the iTheme template. This happened after I updated the WordPress version in its latest which is 3.4.2. At first I thought it was just a plugin conflict but after I tested each of the plugin, the error still persists. The best resort is of course Google for answer and I found out that a lot of other WP users have also encountered the same error.

The error message that appeared was “Warning: Cannot modify header information – headers already sent by (output started at …/wp-includes/general-template.php:2099) in …/wp-includes/pluggable.php on line 866“.

WordPress has already included a solution for this error in their FAQ Troubleshooting page but it does not seem to work on my end. The resolve is to remove extra lines and spaces, before and after the php tag.

What I did to fix that is to comment out the line that caused the error. On my case, it was this line in the general-template.php file.

I just added a double slash at the beginning of the line, saved and tested it. It was a success, and the error disappeared.

This is not a definite solution, and it is most likely that any future update will just put the code back in. I am pretty sure though that WordPress will provide a fix on this on its future versions.

*banner from softwaysolutions.com