Title: How Do I Debug a Plugin?
Last modified: August 19, 2016

---

# How Do I Debug a Plugin?

 *  Resolved [b-rad](https://wordpress.org/support/users/b-rad/)
 * (@b-rad)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/how-do-i-debug-a-plugin/)
 * I’m trying to get my feet wet and learn how to create a WP plugin but I don’t
   see any way to get some basic debug info to show up. I’ve set define( ‘WP_DEBUG’,
   true ); in my wp-config.php file but all I see are messages like:
 * The plugin generated 309 characters of unexpected output during activation. If
   you notice “headers already sent” messages, problems with syndication feeds or
   other issues, try deactivating or removing this plugin.
 * when I activate my test plugin. How can I get more detail including things like
   the 309 characters Wp tells me it sees?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Anonymous User
 * (@anonymized-3085)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/how-do-i-debug-a-plugin/#post-1763968)
 * Sometimes you can’t get more details, depends on what is causing the error.
 * I’d also suggest using `define( 'WP_DEBUG_LOG', true );` as well.
 *  Thread Starter [b-rad](https://wordpress.org/support/users/b-rad/)
 * (@b-rad)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/how-do-i-debug-a-plugin/#post-1764290)
 * Wow, can’t get more details? That seems pretty limiting. Like trying to code 
   with your hands behind your back. I checked out [http://codex.wordpress.org/Editing_wp-config.php](http://codex.wordpress.org/Editing_wp-config.php)
   which says to try changing the config file to:
 * define(‘WP_DEBUG’, true);
    define(‘WP_DEBUG_LOG’, true); define(‘WP_DEBUG_DISPLAY’,
   false); @ini_set(‘display_errors’,0);
 * but my log file gets no errors. This is frustrating. There has to be a better
   way to create a plugin, especially one that deals with db tables.
 *  Thread Starter [b-rad](https://wordpress.org/support/users/b-rad/)
 * (@b-rad)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/how-do-i-debug-a-plugin/#post-1764291)
 * Progress made. I changed my config file to:
 * define(‘WP_DEBUG’, true);
    define(‘WP_DEBUG_LOG’, true); define(‘WP_DEBUG_DISPLAY’,
   true); @ini_set(‘display_errors’,0);
 * and put a debug.log file in my wp-content folder and made it writable by the 
   web server and now I’m actually catching errors.
 *  Anonymous User
 * (@anonymized-3085)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/how-do-i-debug-a-plugin/#post-1764294)
 * did you manage to solve the issue?
 *  Thread Starter [b-rad](https://wordpress.org/support/users/b-rad/)
 * (@b-rad)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/how-do-i-debug-a-plugin/#post-1764295)
 * Yeah, this should do the trick.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘How Do I Debug a Plugin?’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 5 replies
 * 2 participants
 * Last reply from: [b-rad](https://wordpress.org/support/users/b-rad/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/how-do-i-debug-a-plugin/#post-1764295)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
