WordPress “Headers already sent” or “Cookies are blocked due to unexpected output.” also turn on Debug

A few things could cause this, but the first step, is to make sure you didn’t add a space to the top of a file before the <?php!

Warning: Cannot modify header information – headers already sent by (output started at /Applications/MAMP/htdocs/…/wp-login.php:1) in /Applications/MAMP/htdocs/cao/wp-login.php on line 424

Warning: Cannot modify header information – headers already sent by (output started at /Applications/MAMP/htdocs/…/wp-login.php:1) in /Applications/MAMP/htdocs/cao/wp-login.php on line 437

Turning on debugging can help turn the “Cookies are blocked due to unexpected output.” in the warning block just above the login element, into the warning message above, too, which helps.

Add the following to wp-config.php to turn on debugging:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true); 
define('WP_DEBUG_DISPLAY', true);

Leave a Reply

You must be logged in to post a comment.