How to Enable Debugging Mode in WordPress

In WordPress, debugging mode is crucial for developers and site owners aiming to identify and resolve website errors. By enabling it, you can track PHP errors, notifications, and warnings, facilitating efficient troubleshooting. To enable debugging, you need to edit the `wp-config.php` file located in your WordPress installation’s root directory. Access this file via an FTP client or your hosting provider’s file manager and open it with a text editor.
Enable debugging mode by finding the line:
“`php
define(‘WP_DEBUG’, false);
“`
Change `false` to `true`:
“`php
define(‘WP_DEBUG’, true);
“`
This change activates debugging, displaying error messages on site pages. Additional options include:
– **WP_DEBUG_LOG**: Log errors by adding:
“`php
define(‘WP_DEBUG_LOG’, true);
“`
This creates a `debug.log` file in `wp-content` for error review.
– **WP_DEBUG_DISPLAY**: To hide error messages on live sites, set:
“`php
define(‘WP_DEBUG_DISPLAY’, false);
“`
– **Script Debugging**: Load non-minified scripts by adding:
“`php
define(‘SCRIPT_DEBUG’, true);
“`
Remember to deactivate debugging mode after troubleshooting to avoid exposing vulnerabilities:
“`php
define(‘WP_DEBUG’, false);
“`
For more information, consult the [official WordPress documentation](https://wordpress.org/support/article/debugging-in-wordpress/), and consider backing up your site before making changes.