At many times fixing a WordPress error might be a matter of minutes. But that is only possible when you know where the problem is. Given a situation when you do not know where a problem is generating from, it might take you days before you can find out a solution. This is where the WP Debug Log comes really handy. Once you have this feature activated it will display all PHP Error and bugs in a log format.

wp debug log

What is WP_Debug?

Recommended Reading: How to fix the Establishing Database Error in WordPress

WP Debug is a PHP constant (a permanent global variable) that can be used to trigger the “debug” mode throughout WordPress. It is assumed to be false by default and is usually set to true in the wp-config.php file on development copies of WordPress.

How to Enable WP Debug Log to Check for Errors in WordPress 1

WP_Debug Log is a companion to WP_Debug that causes all errors to also be saved to a debug.log file. This is useful if you want to review all notices later or need to view notices generated off-screen. By default, this feature comes disabled. But you can enable this feature any time.

Enable Debugging Mode

  • Login to your Website's Cpanel. You might also access your account via SSH.
  • If you are using Cpanel, go to File Manager and open the file wp-config.php. But if you are using SSH, use a command prompt and open the wp-config.php file.
  • Add the following line of text to enable debugging mode – define(‘WP_DEBUG', true);
  • That's it, the Debugging mode is now enabled on your WordPress Website.

Wrapping Up!

You might want to keep the WP Debug Mode enabled while you are developing something. As you are working on your project, you might end up catching new PHP Error.  Once you are done fixing the errors you can disable the WP Debug Mode. For disabling the debugging mode, you need to set the  WP DEBUG to False. To do so, first navigate to your CPanel, locate the wp-config.php file, and then add following lines – define(‘WP_DEBUG', false);

Leave a Reply

Your email address will not be published. Required fields are marked *