How to use WP_DEBUG

Table of Content

If you have problems with your website and need to find out what errors are causing it, the built-in method with WordPress is to use the WP_DEBUG setting.

When this feature is turned on, all errors are written to a text file that you can open and get more details from about what is causing the problem.

Keep in mind, this file can contain sensitive data about your website or server, so you should not leave this feature turned on all the time, only when fixing errors.

How to enable WP_DEBUG

Open the file wp-config.php (usually found in the root of your website) and make sure the following settings are set up, and if they do not exist add them to the file:

define('WP_DEBUG', true); 
define('WP_DEBUG_LOG', true); 
define('WP_DEBUG_DISPLAY', false);

Once you have saved the changes you can go back to your website and try the same again, this time all errors should be written to the debug file, usually found in the folder /wp-content/debug.log

Read more on how to prevent errors showing up in the frontend.

Remember, once you have finished debugging, turn off the debugging again by setting “WP_DEBUG” to “false”. You should also remove the debug.log file or use WP Security Ninja to block access to this file.


Was this helpful?

Next Article

Re-install WordPress

Still need help?

If searching the knowledge base does not help you, please contact support.

Fast and easy to use WordPress Security

Instantly protect your website from 600+ million bad IPs

10% OFF

Subscribe to our newsletter

* We do not spam or share your email

Discount on any Security Ninja plan

and get

Hi and welcome back :-)

We won't spam you. Unsubscribe any time.

Wait! Before you go!

Get 10% discount for any WP Security Ninja plan!


Subscribe to our newsletter for new releases, discounts and general WordPress Security news. Sprinkled with other interesting stuff :-)