Title: Hide Default User Roles
Last modified: August 21, 2016

---

# Hide Default User Roles

 *  Resolved [Kyle H](https://wordpress.org/support/users/cikez/)
 * (@cikez)
 * [13 years ago](https://wordpress.org/support/topic/hide-default-user-roles/)
 * First of all I would like to thank you for the great plugin.
 * Now I have researched several sites and cannot for the life of me find a way 
   to do this. I want to use User Role Editor to create my own custom user roles
   but I do not want the default user roles of wordpress to still be available in
   the dropdown menu’s. Example: Author, Subscriber, etc..
 * Do you know if there is anyway to hide these roles completely?
 * Thanks!
 * [http://wordpress.org/extend/plugins/user-role-editor/](http://wordpress.org/extend/plugins/user-role-editor/)

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

 *  Plugin Author [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/)
 * (@shinephp)
 * [13 years ago](https://wordpress.org/support/topic/hide-default-user-roles/#post-3842654)
 * Try to add this code into your active theme functions.php file:
 *     ```
       if (!current_user_can('administrator')) {
       add_filter('editable_roles', 'exclude_role' );
       public function exclude_role($roles)
       {
   
           if (isset($roles['administrator'])) {
             unset($roles['administrator']);
           }
   
           return $roles;
       }
       }
       ```
   
 * If it work for you, add code for the rest of WP roles.
 *  Thread Starter [Kyle H](https://wordpress.org/support/users/cikez/)
 * (@cikez)
 * [13 years ago](https://wordpress.org/support/topic/hide-default-user-roles/#post-3842657)
 * Vladimir,
 * I tried adding the following code to my themes functions.php file and got
 *     ```
       if (!current_user_can('author')) {
       add_filter('editable_roles', 'exclude_role' );
       public function exclude_role($roles)
       {
   
           if (isset($roles['author'])) {
             unset($roles['author']);
           }
   
           return $roles;
       }
       }
       ```
   
 * “HTTP Error 500 (Internal Server Error): An unexpected condition was encountered
   while the server was attempting to fulfill the request.”
 * Any ideas?
 *  [Clayton Kreisel](https://wordpress.org/support/users/claytonkreisel/)
 * (@claytonkreisel)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/hide-default-user-roles/#post-3842799)
 * Kyle,
 * Get rid of the “public” in front of function. I ran this and everything works
   great.
 *     ```
       function exclude_role($roles) {
   
       		//Hide Defualt Roles
       	    if (isset($roles['author'])) {
       	      unset($roles['author']);
       	    }
   
       		if (isset($roles['editor'])) {
       	      unset($roles['editor']);
       	    }
   
       		if (isset($roles['subscriber'])) {
       	      unset($roles['subscriber']);
       	    }
   
       		if (isset($roles['contributor'])) {
       	      unset($roles['contributor']);
       	    }
   
       	    return $roles;
       	 }
       	 add_filter('editable_roles', 'exclude_role' );
       ```
   

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

The topic ‘Hide Default User Roles’ is closed to new replies.

 * ![](https://ps.w.org/user-role-editor/assets/icon-256x256.jpg?rev=1020390)
 * [User Role Editor](https://wordpress.org/plugins/user-role-editor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-role-editor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-role-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/user-role-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-role-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-role-editor/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Clayton Kreisel](https://wordpress.org/support/users/claytonkreisel/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/hide-default-user-roles/#post-3842799)
 * Status: resolved