How to enable debug mode under wordpress?
WordPress comes with several settings that you can use to help debug the main application, themes, your own custom code, and more.
Generally, these settings are intended for use by developers and should not be used on "live" sites. However, you may need to use them in specific scenarios to help troubleshoot issues you may be experiencing with third-party code, such as plugins or themes.
To enable debugging mode in WordPress, follow these steps:
- Using the cPanel "File Manager", open the wp-config.php file in your preferred text editor.
- To enable debugging mode, add the following line to the wp-config.php file:
By enabling WP_DEBUG, WordPress displays all PHP errors, notices, and warnings.
- Save your changes and exit the text editor. The debug mode is now active.
When you are done, disable debugging mode by modifying the line in the wp-config.php file as follows:
ADDITIONAL DEBUGGING OPTIONS
There are several additional settings you can use to control the debugging information that WordPress provides:
- WP_DEBUG_LOG: When WP_DEBUG_LOG and WP_DEBUG are enabled, WordPress saves all error information to the debug.log file in the wp-content directory. By default, this setting is disabled. To enable this setting, add the following line to the wp-config.php file:
- WP_DEBUG_DISPLAY: When WP_DEBUG_DISPLAY and WP_DEBUG are enabled, WordPress displays error and warning messages on web pages. By default, this setting is enabled. When this setting is disabled, debugging messages are hidden from view. To disable this setting, add the following line to the wp-config.php file: