Knowledge Base
WordPress: How to Enable or Disable WP_Debug
If you receive an error on your WordPress site and are unsure about it, you can enable wp_debug mode within the website’s wp-config.php file. Enabling the debugging feature will help you identify and troubleshoot code errors in the core software, themes, and plugins.
Managing WP_Debug Mode
Important: Before making any changes to troubleshoot your website, it is strongly recommended that you back up all your files and any database(s) associated with it.
For accounts created before April 2024, please follow these steps.
- Launch your FTP client to connect to your hosting server. To learn how to connect to your hosting server using an FTP, visit the FTP: How to Connect Using an FTP Client article.
- Once connected, navigate to your site's folder (document root) and download the wp-config.php file.
- Edit the wp-config.php file using a text editor, such as Notepad.
- Look for the script define( 'WP_DEBUG', false );.
- Change the 'false' value to 'true.' Be sure not to accidentally delete any additional characters or text, as it could cause another critical error.
- Save the file after making the change.
- Go back to FileZilla and re-upload the wp-config.php file you just edited. Select OK to overwrite the file.
- Refresh your website to trigger the error codes. In the screenshot below, we can see that the error is due to a plugin called Contact Form 7.
- Using your FTP client, navigate to the plugin folder and rename the Contact Form 7 (contact-form-7) folder.
- If this is the cause of the error, breaking that connection by renaming the file should allow the site to come back without the error.
Important: Be sure to restore the define( ‘WP_DEBUG’, false ); code when you are finished troubleshooting. Otherwise, it can leave your website more vulnerable to hacking attempts.
For accounts created after April 2024, please follow these steps.
- Log in to your Account Manager.
- Click Hosting and click the MANAGE button to go to the hosting settings page.
- Select Pointers & Subdomains on the left-hand menu.
- The next page will show you the directory or path where the WordPress files are in. Take note of the directory.
- Navigate back to your hosting settings page and click File Manager on the left pane.
- Within File Manager, navigate to your site's folder or directory you've taken note of earlier.
- Locate your site's wp-config.php, click on the three-dotted icon on the right, and then select Edit.
- To enable WP_Debug, change the last line to: define( 'WP_DEBUG', true).
- To disable WP_Debug, change the last line to: define( 'WP_DEBUG', false).
- Click Save.
Are there more debugging tools?
WP_Debug is designed to work with additional tools, which are enabled in the same way as WP_Debug.
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
Learn more about WP_Debug_Log and WP_Debug_Display by visiting WordPress.org.
Important: WP_Debug_Log will store records of your error messages on your hosting account. These records take up disk space, so we recommend only having it active while you are troubleshooting your website. If you leave it on for an extended period of time, you could run the risk of eventually violating our normal usage policy.
Want to learn more about WordPress?
You can always check out WordPress.org and browse their codex or online help forums.