Thinking about why you need to enable debug log in WordPress.
Well, often, while using WordPress, you might come across some issues and errors that are not recorded and might become difficult to identify and resolve.
Upon enabling the debug log, WordPress starts recording your site’s errors and warnings and provides detailed information about them. This helps you identify and fix issues more easily.
Now that you know how enabling a debug log in WordPress might help you, let’s understand how to enable a debug log.
Enabling Debug Log In WordPress #
To enable the debug log in WordPress, follow the following steps:
Step 1: Login to your server through FTP.
[To learn about how to set up FTP for your WordPress site, refer to What Is FTP? – Ultimate Beginner’s Guide For WordPress Users]
Step 2: Next, open the wp-config.php file in the root directory of your WordPress installation.
Step 3: You’ll see the following line of code at the bottom of the file.
define( 'WP_DEBUG', false );
Step 4: Replace the above-mentioned code with the three lines provided below. In simple words, copy the code snippet below and paste it over the line of code mentioned in the last step.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true );
By following this simple step, you can enable debugging on your WordPress site and avoid any logged data from being displayed on your site.
Leave a Reply