Enable WordPress Debugging For Efficient Plugin Development

Enable WordPress Debugging For Efficient Plugin Development

Enable WP_DEBUG and start seeing PHP notices and also WordPress-generated debug messages.

This is helpful when building plugins. WP_DEBUG tells PHP to report more errors, specifically “notices,” since WordPress normally instructs PHP to only report warnings and fatal errors. It also will help you to know if you’re using a deprecated function, deprecated file, or an old API.

Simply open wp-config.php and define:

FREE EBOOK
Your step-by-step roadmap to a profitable web dev business. From landing more clients to scaling like crazy.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

FREE EBOOK
Plan, build, and launch your next WP site without a hitch. Our checklist makes the process easy and repeatable.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

define( 'WP_DEBUG', true );

You can also define WP_DEBUG_DISPLAY and WP_DEBUG_LOG to suppress the notices and log them to a wp-content/debug.log file if you’re debugging on a production site:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
ini_set( 'display_errors', 0 );

Tags: