To enable WordPress debug logging, edit the wp-config.php file, find the following line.
1 | define('WP_DEBUG', false); |
define('WP_DEBUG', false);
Replace it with the code below.
1 2 3 4 5 6 7 8 9 | // Enable WP_DEBUG mode define('WP_DEBUG', true); // Enable Debug logging to the /wp-content/debug.log file define('WP_DEBUG_LOG', true); // Disable display of errors and warnings define('WP_DEBUG_DISPLAY', false); @ini_set('display_errors',0); |
// Enable WP_DEBUG mode define('WP_DEBUG', true); // Enable Debug logging to the /wp-content/debug.log file define('WP_DEBUG_LOG', true); // Disable display of errors and warnings define('WP_DEBUG_DISPLAY', false); @ini_set('display_errors',0);
Perform the action that causes the error again, and the error message should appear in the file /wp-content/debug.log.
Note: you should disable debug logging when you’ve finished debugging, by reversing the above change.
If the debug.log file does not appear
This usually means that PHP doesn’t have write access to the wp-content folder to create the file. Create a file name debug.log on your local computer and upload it to the wp-content folder via FTP. Once the file has uploaded, set the file permissions to 666.