# Warning Cannot modify header information

Canonical URL: https://lancelhoff.com/warning-cannot-modify-header-information/
Published: 2009-01-14
Last modified: 2009-01-14
Description: Fix the PHP “Cannot modify header information” warning by finding output sent before headers, such as stray spaces, blank lines, or debug text.

---

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](https://lancelhoff.com/wp-content/uploads/2009/01/warning-headers-600x80.webp)

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

![Cannot Modify Header Information Warning. Empty Lines before the opening <?php caused this error](https://lancelhoff.com/wp-content/uploads/2009/01/empty-lines-600x198.webp)

![Warning](https://lancelhoff.com/wp-content/uploads/2009/01/warning-headers2-600x59.webp)

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

![Empty Lines after the closing ?> tag caused this error](https://lancelhoff.com/wp-content/uploads/2009/01/empy-lines2-600x226.webp)

## How to fix the headers already sent Warning

1. 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...)
2. Login to your server using an FTP client
3. From your server, locate and download the culprit file to your computer
4. 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
5. Upload the file back to your server, overwriting the existing file if prompted
6. Test to see if the error is fixed
