In this article we’re taking a look at how to enable WP_DEBUG and why you might need / want to.
Why you might use WP_DEBUG:
First let’s take a look at why. WordPress can be a complex ecosystem of plugins, themes, and code. Sometimes when you update a plugin or theme, or edit code it may throw up an error.
However for many other errors / updates strange things can happen such as sections of your site not loading, plugins not functioning correctly, data being sent incorrectly or the general functionality of your site not loading as it should.
When this occurs, enabling WP_DEBUG can be a super helpful resource as it logs all errors, notices and warnings. Subsequently helping you to narrow down the exact file / item of code that is causing the particular issue.
When you might use WP_DEBUG:
It’s not generally advisable to enable WP_DEBUG on a live website as it will output the errors that are causing the issues to the front-end of the website. If at all possible you should only use WP_DEBUG on a duplicate or staging version of your website.
Another time that it’s highly useful is when developing a new website either locally within your development environment or on a staging website. Throughout the process WP_DEBUG can help to make correcting any code / plugins much quicker.
We would only recommend using WP_DEBUG if you’re an experienced developer or have thorough backups of your website.
How to use WP_DEBUG:
WP_DEBUG is found in your wp-config.php file. To access this file you will need to either use your hosting side file manager or an SFTP / FTP tool. If you’re unsure on either take a look at our article here:
Once you’ve accessed your public_html folder and subsequently found your wp-config.php file. You will need to open it with either your hosting side code editor or a dedicated code editor.
Within this file you will need to look for the line that says:
define( ‘WP_DEBUG’, false );
This currently sets WP_DEBUG to not enabled.
By changing this line to:
define( ‘WP_DEBUG’, true );
You can enable WP_DEBUG.
Once you’ve used the tool to achieve what you needed to you would simply follow the reverse of this process and set it back to false.
Further Reading:
How to Fix ‘The Link You Followed Has Expired’ Error in WordPress
Summary:
WP_DEBUG can be an extremely powerful tool for determining the source of any errors on your website, however it should be used cautiously and only on staging / testing websites where possible.
We hope you found this useful, if you did we would really appreciate any comments / shares thanks!








