You got an error. The first thing we do is to check the error logs or reports. The logs or reports make it the developer or any tech guy easy to solve the problems.

Today we will enable some of the hidden variables which can help us debug the WordPress errors more easily. These variables are mostly enabled only for the development process, not on production websites. Let’s get to the point now.

You need to add the following lines of code in the wp-config.php file in WordPress.

wp-config.php File Path

1
2
3
4
5
6
7
<?php 

define('WP_DEBUG', true); // update false to true
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);

After the changes, you’ll get a more detailed error information. Once you finished debugging or testing please remove the lines of codes and set WP_DEBUG constant to false.

Happy Coding 😎