Announcing One-Click Restores, Disaster Recovery, and More
Diagnosing WordPress issues, especially for non technical individuals can be daunting. This guide shows you a quick way to use the error log to give you feedback on what’s wrong with your site.
Retrieving error log entries allows you to either fix the problem yourself or have someone knowledgeable in WordPress internals handle it.
Log into your hosting provider account and bring up your CPanel or equivalent interface. Open the File Manager.
This will most likely be in the public_html directory or a subdirectory of public_html depending on if you are hosting more than one domain with this account.
Make a backup of wp-config.php to ensure you can restore the system after you’re done debugging.
Note: When you make a backup of the file using the CPanel File Manager, a dialog will ask you where you want to copy the file to. Since you’re just copying a backup to the same directory, type in a new filename here as shown below.
The following constant definitions need to be either added or edited in your wp-config.php file:
define('WP_DEBUG', true); define('WP_DEBUG_LOG', true);
Most WordPress installations already have an entry for WP_DEBUG set to false so you’ll need to change this value to true. It’s not that common to have WP_DEBUG_LOG already set in the wp-config so most likely you’ll have to add that line.
This page has a detailed explanation of what the debugging directives do.
You may have observed the problems on a particular screen on the admin page, page on your site or are experiencing something as catastrophic as your site not coming up at all. Go into WordPress and simply repeat the operation or refresh the page that isn’t working properly.
Go to the WordPress content folder. This is usually called wp-content, unless you renamed it with a security plugin.
Open the log file debug.log, go to the bottom and look for line entries with timestamps that correspond to your recent site interactions. You may see zero, one, or many lines with the appropriate timestamp.
Depending on your level of confidence and understanding you can either act on this information or copy and paste the latest log entries into an email that you can send to someone more technical.
Finally, remove the wp-config.php that you edited and rename the copy to wp-config.php