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.
FREE EBOOK
Plan, build, and launch your next WP site without a hitch. Our checklist makes the process easy and repeatable.
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 );