Get the Best WordPress Backup
& Migration Plugin Today
Get Duplicator Now
Announcing one click restores, disaster recovery, and more

Announcing One-Click Restores, Disaster Recovery, and More

Want to be able to restore your site with just one click? In the newest version of Duplicator, we're launching…
How to use the WordPress error log

The WordPress Error Log is your Friend 

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.

Steps to capture the error log

1. Open the File Manager in your web host’s management panel.

alt=
Log into your hosting provider account and bring up your CPanel or equivalent interface. Open the File Manager.

Wordpress hosting cPanel

2. Go to the document directory of your website installation.

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.

Wordpress website directory

3. Make a backup of wp-config.php.

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.

Copying wp-config.php to a new name

4. Open wp-config.php and insert or edit lines that control logging.

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.

wordpress migration with DuplicatorAfter you’re done editing ensure that WP_DEBUG and WP_DEBUG_LOG are set to true and that each constant is only defined once in wp-config.php

This page has a detailed explanation of what the debugging directives do.

5. Repeat the failed WordPress operation.

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.

6. Go to the WordPress content folder and open debug.log.

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.
Wordpress error log entries

7. Fix identified problems yourself or send log information to someone who can.

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.

8. Restore the original wp-config.php.

Finally, remove the wp-config.php that you edited and rename the copy to wp-config.php

Comments

Comments are closed.