Skip to main content
All CollectionsWordPress
Enable WordPress Debugging
Enable WordPress Debugging

How to debug PHP errors in WordPress by enabling WP debug in wp-config.php

Karl avatar
Written by Karl
Updated over a week ago

WP_DEBUG is a PHP constant (a permanent global variable) that can be used to trigger the “debug” mode throughout WordPress. It is assumed to be false by default and is usually set to true in the wp-config.php file on development copies of WordPress.

In the root folder of your website, find the wp-config.php file and add the following lines:

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

: You must insert this BEFORE /* That's all, stop editing! Happy blogging. */in the wp-config.php file.

When WP_DEBUG_LOG set to true, the log is saved to wp-content/debug.log

Source & more info: Debugging in WordPress 

Did this answer your question?