How to enable debugging in WordPress?

Add these lines in wp-config.php (above the line “That’s all, stop editing”):

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );       // save errors in wp-content/debug.log
define( 'WP_DEBUG_DISPLAY', false );  // do not show errors on the page

You can set them with WP-CLI, too:

Terminal output

$ wp config set WP_DEBUG true –raw
Success: Added the constant 'WP_DEBUG' to the 'wp-config.php' file with the raw value 'true'.
$ wp config get WP_DEBUG
1
$ wp config delete WP_DEBUG
Success: Deleted the constant 'WP_DEBUG' from the 'wp-config.php' file.

Turn debugging off on a live site. Learn more in WordPress Debugging.


Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.