Warning: Cannot modify header information - headers already sent by (output started at... If your receiving an error like this in your web browser just after trying to edit a file, the culprit is most likely that there are spaces, misc characters or newlines either just before an opening <?php
tag or right after a closing ?>
tag. In WordPress, the problem may appear from a corrupt wp-config.php file. However, the problem can occur in other files as well.
Cannot modify header information - WordPress
Warning: Cannot modify header information - headers already sent by (output started at /home/username/public_html/wordpress/wp-config.php:2) in /home/username/public_html/wordpress/wordpress/wp-admin/theme-editor.php on line 70
Warning: Cannot modify header information - headers already sent by (output started at /home/username/public_html/wordpress/wp-config.php:78) in /home/username/public_html/wordpress/wp-includes/pluggable.php on line 850
How to fix the headers already sent Warning
- From the error message, locate the file that caused the error. This is reported by the section of the warning that starts (output started at...)
- Login to your server using an FTP client
- From your server, locate and download the culprit file to your computer
- Open the culprit file using a text editor and remove any extra spaces, lines or characters before the opening <?php or after the closing ?> tags
- Upload the file back to your server, overwriting the existing file if prompted
- Test to see if the error is fixed