How to Enable WP Debug mode in WordPress Website
How to Enable WP Debug Mode in WordPress
Enabling the WP-Debug mode in WordPress will help you display and easily notice website errors even in your WordPress website. This setting, option can be enabled by editing the wp-config.php found in your public_htm file, in the root directory of the website file manager. This blog will guide you on how to enable WP Debug mode in WordPress website. This can help you easily detect and solve website and WordPress website errors such as Localhost is currently unable to handle this request HTTP Error 500.
Important Considerations Before Enabling WP Debug Mode in WordPress.
- Important: Always back up your
wp-config.php
file before making any changes. - Security: Leaving debugging enabled on a live site can expose sensitive information, so always disable it when not in use.
Access the Cpanel : To access the file manager, Log into your website cpanel.
Navigate to the public_html file/ folder
Locate the wp-config.php file and right-click to edit the file.
Press and hold CTRL + F key in your keyboard to search for the words “WP_DEBUG” and locate the define( ‘WP_DEBUG’, false ); in your editor
Now you can edit the line define(‘WP_DEBUG’, false); and set it to true as define(‘WP_DEBUG’, true); or replace the line of code with the one below. However, if you don’t find the line of code, you can add it as follows and click save to save all your changes
1. define(‘WP_DEBUG’, true);
2. define(‘WP_DEBUG_LOG’, true);
3. define(‘WP_DEBUG_DISPLAY’, false);
4. @ini_set(‘display_errors’, 0);
WP_DEBUG: When this variable is set to true, WordPress enters debug mode.
WP DEBUG_LOG: If this option is enabled, all errors are logged to a file called debug.log located in the wp-content directory.
WP_DEBUG_DISPLAY: This variable, when set to false, prevents problems from showing up on the website’s front end. This helps shield users from error warnings in a live situation.
This piece of code, @ini_set(‘display_errors’, 0), further guarantees that PHP errors are not shown on the website.
Follow us through our Facebook page to stay tuned on the latest post.
Leave a Reply