Title: WP_DEBUG on only for admin user?
Last modified: August 20, 2016

---

# WP_DEBUG on only for admin user?

 *  [KatieBen](https://wordpress.org/support/users/katieben/)
 * (@katieben)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/wp_debug-on-only-for-admin-user/)
 * Hi there,
 * How would I set WP_DEBUG to true, only for the admin user? I tried checking for
   the user ID 1, via:
 * if(function_exists(“wp_get_current_user”) && wp_get_current_user()->ID == 1)
   
   define(‘WP_DEBUG’, true); else define(‘WP_DEBUG’, false);
 * I tried putting this in both the config file and the header file of my theme,
   though neither worked. Has anyone done this?

Viewing 1 replies (of 1 total)

 *  [Jackson Whelan](https://wordpress.org/support/users/madjax/)
 * (@madjax)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/wp_debug-on-only-for-admin-user/#post-2274140)
 * I think that wp-config.php is too early to check for the user, and your theme’s
   functions.php file is too late to define WP_DEBUG – of course I could be wrong…
 * Instead you could setup an error log, and silence the notices.
 * > `/**
   >  * This will log all errors notices and warnings to a file called debug.
   > log in * wp-content (if Apache does not have write permission, you may need
   > to create * the file first and set the appropriate permissions (i.e. use 666))*/
   > define(‘WP_DEBUG’, true); define(‘WP_DEBUG_LOG’, true); define(‘WP_DEBUG_DISPLAY’,
   > false); @ini_set(‘display_errors’,0);`
 * [http://codex.wordpress.org/Editing_wp-config.php#Configure_Error_Log](http://codex.wordpress.org/Editing_wp-config.php#Configure_Error_Log)

Viewing 1 replies (of 1 total)

The topic ‘WP_DEBUG on only for admin user?’ is closed to new replies.

## Tags

 * [admin user](https://wordpress.org/support/topic-tag/admin-user/)
 * [wp-config](https://wordpress.org/support/topic-tag/wp-config/)
 * [wp_debug](https://wordpress.org/support/topic-tag/wp_debug/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Jackson Whelan](https://wordpress.org/support/users/madjax/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/wp_debug-on-only-for-admin-user/#post-2274140)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
