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:

1
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:

1
2
3
4
define( 'WP_DEBUG', true ); 
define( 'WP_DEBUG_LOG', true ); 
define( 'WP_DEBUG_DISPLAY', false ); 
ini_set( 'display_errors', 0 );

Featured Plugin - WordPress Infinite SEO Plugin

Fully integrated with the SEOMoz API, complete with automatic links, sitemaps and SEO optimization of your WordPress setup - this is the only plugin you need to help you rank your site number 1 on Google - nothing else compares.
Find out more

Featured Plugin - WordPress Ecommerce Shopping Cart Plugin

Out of all the WordPress ecommerce plugins available, MarketPress has got to be the winner - easy to configure, powerful functionality, multiple gateways and more. A simply brilliant plugin!
Find out more

Featured Plugin - WordPress Appointments Plugin

Take, set and manage appointments and client bookings without having to leave WordPress. Appointments+ makes it easy.
Find out more

Featured Plugin - WordPress Facebook Plugin

Would you like to add Facebook comments, registration, 'Like' buttons and autoposting to your WP site? Well, The Ultimate Facebook plugin has got that all covered!
Find out more

Featured Plugin - WordPress Q&A Site Plugin

It's now incredibly easy to start your own Q&A site using nothing more than WordPress - The Q&A plugin simply and brilliantly transforms any site, or page, into a perfect support or Q&A environment.
Find out more

Featured Plugin - WordPress Wiki Plugin

To get a wiki up and running you used to need to install Mediawiki and toil away for days configuring it... not any more! This plugin gives you *all* the functionality you want from a wiki, in WordPress!!!
Find out more

Featured Plugin - WordPress Pop-Up Chat Plugin

No javascript required, no third part chat engine, just fully featured chat right in your own database on your own WP sites - couldn't be easier.
Find out more

Featured Plugin - WordPress Newsletter Plugin

Now there's no need to pay for a third party service to sign up, manage and send beautiful email newsletters to your subscriber base - this plugin has got the lot.
Find out more

Featured Plugin - WordPress Membership Site Plugin

If you're thinking about starting a paid, or just private, membership site then this is truly the plugin you've been looking for. Easy to use, massively configurable and ready to go out of the box!
Find out more

Comments (3)

  1. Thanks a lot, Sarah!

    I was aware of ‘WP_DEBUG’ but I didn’t know that it’s also possible to log those errors, specially supressing their output on display.
    Nice tip, thanks again :)

  2. Thank you very mutch for this article. After reading a while the very helpful articles on this page I really regret the decision to have my blog on blogger since I can´t apply the mentioned methods. But if I get another blog I´ll definetly try WP!

    Greetings.

Participate