Title: Adding &quot;remove_users&quot; Capability
Last modified: August 19, 2016

---

# Adding "remove_users" Capability

 *  [Kruncher](https://wordpress.org/support/users/kruncher/)
 * (@kruncher)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/adding-remove_users-capability/)
 * I am using the following code to allow “Editors” to manage users, but I need 
   to prevent “Editors” from removing or demoting “Admins”:
 *     ```
       $editor_role = get_role('editor');
       $editor_role->add_cap('list_users');
       $editor_role->add_cap('create_users');
       $editor_role->add_cap('remove_users');
       $editor_role->add_cap('promote_users');
       ```
   
 * Any help would be greatly appreciated!
 * Kind regards

The topic ‘Adding "remove_users" Capability’ is closed to new replies.

## Tags

 * [add_cap](https://wordpress.org/support/topic-tag/add_cap/)
 * [capability](https://wordpress.org/support/topic-tag/capability/)
 * [get_role](https://wordpress.org/support/topic-tag/get_role/)
 * [permission](https://wordpress.org/support/topic-tag/permission/)
 * [role](https://wordpress.org/support/topic-tag/role/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Kruncher](https://wordpress.org/support/users/kruncher/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/adding-remove_users-capability/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
