Title: Deny switch_users capability
Last modified: July 25, 2020

---

# Deny switch_users capability

 *  [cascadingpixels](https://wordpress.org/support/users/cascadingpixels/)
 * (@cascadingpixels)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/deny-switch_users-capability/)
 * Regarding this statement:
    If you know what you’re doing with user capabilities,
   this (switch_users) capability can also be denied from a user or role to prevent
   the ability to switch users, regardless of whether or not they have the edit_users
   capability.
 * I attempted to add the switch_users capability via User Role Editor and then 
   deselect it for a specific role. This role needs to be able to add and edit users
   but not switch to a different user. However, this method didn’t work. Is this
   the right syntax for the capability? I guess it may be necessary to do this via
   the functions file but wanted to check first. Any advice would be appreciated.
   Thanks for this plugin. It’s amazing.
 * Diane

Viewing 1 replies (of 1 total)

 *  Plugin Author [John Blackbourn](https://wordpress.org/support/users/johnbillion/)
 * (@johnbillion)
 * WordPress Core Developer
 * [5 years, 10 months ago](https://wordpress.org/support/topic/deny-switch_users-capability/#post-13168629)
 * I’m not familiar with the User Role Editor plugin, but in the Members plugin 
   for example it provides an explicit checkbox for denying a capability.
 * Does User Role Editor provide the same thing? If not, you might find that it’s
   simply not granting the role instead of explicitly denying it.
 * I think I need to add some more documentation around this because it’s a fairly
   common request. I’ll dig out some example code.

Viewing 1 replies (of 1 total)

The topic ‘Deny switch_users capability’ is closed to new replies.

 * ![](https://ps.w.org/user-switching/assets/icon.svg?rev=3193956)
 * [User Switching](https://wordpress.org/plugins/user-switching/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-switching/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-switching/)
 * [Active Topics](https://wordpress.org/support/plugin/user-switching/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-switching/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-switching/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [John Blackbourn](https://wordpress.org/support/users/johnbillion/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/deny-switch_users-capability/#post-13168629)
 * Status: not resolved