The WordPress website is showing the following warning and may not be loading otherwise
Warning: Cannot modify header information - headers already sent by (output started...
This may be caused by debug headers being sent multiple times when debugging is enabled.
Related Articles
Enable and Configure Debugging for WordPress
Enable/Disable Error Reporting in PHP
WordPress Displaying PHP Warnings/Errors on Site
Resolve Warning
- Disable error displaying through the MultiPHP INI Editor
TIP: As this warning is caused by headers being sent multiple times, disabling the debug display can often resolve any issues. If the site is still loading incorrectly, proceed to review PHP and WordPress error logs for more information.
Review PHP Error Log
- Determine the log location
- Create a phpinfo page
- Find the error_log value on the phpinfo.php page
TIP: Ctrl+F (Windows) or Command+F (Mac) can be used to quickly search for the error_log phrase in the phpinfo.php page. - If the error_log value is set to /dev/null, enable PHP error logging
- Edit .user.ini in the site's document root
- Add or modify the following
error_log = error_log
TIP: This will log any PHP errors to a file called error_log in the document root.
- Remove the phpinfo page created in step 1A
- Refresh the site
- Check the PHP error log for any new errors
- Resolve any errors
NOTE: This will typically involve disabling the plugin that is referenced in the error. For more involved error resolution, a WordPress developer should be consulted.
Review WordPress Debug Log
- Navigate to the site's document root
- Right-click and Edit
wp-config.php
- Add or modify the following
define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false);
NOTE: The debug display is set to false in order to prevent the errors from displaying on the site. Setting the debug log to true allows us to check the errors using the log file instead. - Click Save Changes on the top right of the screen
- Refresh the website
- Check the WordPress debug log in the website's document root at
wp-content/debug.log
for any new errors - Resolve any errors
NOTE: This will typically involve disabling the plugin that is referenced in the error. For more involved error resolution, a WordPress developer should be consulted.