Errors in WordPress are common almost everytime you do something with your blog. You may be installing a plugin or setting up something with your WordPress theme, suddenly you will be ending up with an annoying error.

This happens to every WordPress user, not just you and me. Depending on the complexity of the problem, you will be struggling to resolve it.

There come the Error Logs.

  • Error logs are a way to identify what is happening inside WordPress. It shows all the error messages and using that you get a clue to fix those errors.
  • By default, error logs in WordPress are not enabled. You have to manually enable it.

The next time when you are into a WordPress issue, you can simply enable the error logs. Reproduce the issue. Read the error logs and understand what exactly caused the issue.

Based on the error logs, you can fix the issue yourself or pass it to your developer for an easier fix.Corrects Steps to Enable Error Logs for debugging

In this article, I will take you through the correct steps to enable error logs in WordPress so that you don’t need to struggle a lot.

  1. Login to your web hosting cPanel.
  2. Open the File Manager as shown in the below screenshot. The file manager is the cPanel tool used to manage the files hosted on your web server.Open the file manager
  3. Navigate to the root folder of your blog where you can locate the wp-config.php file.Edit wp-config.php file to enable error logs in WordPress
  4. Select the wp-config.php file, click Edit and add the following lines to it:
    1. define (‘WP_DEBUG’, true);
    2. define (‘WP_DEBUG_LOG’, true);
  5. Save the wp-config.php file.
  6. Done, now you have correctly enabled the error logs.

Once you saved the wp-config.php file, try to reproduce the issue again.

That means now onwards whenever you see the issue, WordPress adds all the errors as debug prints into the log files. The log files are stored in the same root directory of the blog with the filename debug.log.

In fact, not just errors whatever debug prints added in the WordPress core are all logged into the debug.log file.

You can open the debug.log file and you will be able to see the error messages logged in it. You can also refer to more information about debugging using error logs from the official page here.

List of WordPress plugins to enable error logs:

The easiest way to enable error logs is to open the wp-config.php file, add the lines define (‘WP_DEBUG’, true); define (‘WP_DEBUG_LOG’, true); and Save it. Now error logs will be enabled and stored in the file debug.log.

I hope you are able to enable error logs on your WordPress blog. If you find any other way to enable WordPress debug logs, please leave a comment, it may be helpful to other WordPress users.

2018-01-22T22:02:51+00:00

About the Author:

I love-to-code, passionate-to-write, an upcoming author, and WordPress enthusiast. Here at BlashO, I mostly share WordPress tips. Connect with me @Twitter.

Leave A Comment