Title: Switch role
Last modified: June 2, 2026

---

# Switch role

 *  Resolved [naresh11381](https://wordpress.org/support/users/naresh11381/)
 * (@naresh11381)
 * [5 days, 15 hours ago](https://wordpress.org/support/topic/switch-role/)
 * Hi there,
 * Firstly, this is one of the best free plugins available, thanks for maintaining
   it.
 * I have a fairly niche edge case and wanted to check whether something might be
   possible.
 * Just to be clear, the plugin itself is working correctly as designed. User Switching
   is successfully switching users in all normal WordPress functionality.
 * I use Plugin Organizer to enable/disable functionality based on roles. After 
   switching users, when I debug the current role it still reports the initial logged-
   in role rather than the switched user’s role, even though the switched user is
   otherwise functioning correctly throughout WordPress.
 * Is there any way to make WordPress fully return the switched user’s role everywhere,
   or is this simply a limitation of how User Switching works internally?
 * Thanks again, really appreciate the plugin.

Viewing 1 replies (of 1 total)

 *  Plugin Author [John Blackbourn](https://wordpress.org/support/users/johnbillion/)
 * (@johnbillion)
 * WordPress Core Developer
 * [4 days, 21 hours ago](https://wordpress.org/support/topic/switch-role/#post-18927339)
 * Thanks for the message.
 * When you switch between users with User Switching, you genuinely get logged in
   as that user, there’s no pretending or mocking, and no overriding or filtering
   of user data or role data. The behaviour is identical to if you logged in with
   that user’s username and password.
 * What this ultimately means is if you’re seeing stale role data then there’s likely
   a caching issue. Perhaps you’re reading the role from a user object that was 
   instantiated prior to switching user? The `wp_get_current_user()` function and
   the `current_user_can()` function all work as expected after switching user.

Viewing 1 replies (of 1 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fswitch-role%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](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: [4 days, 21 hours ago](https://wordpress.org/support/topic/switch-role/#post-18927339)
 * Status: resolved