Title: Trigger User Switch
Last modified: August 31, 2016

---

# Trigger User Switch

 *  Resolved [eliteweblabs](https://wordpress.org/support/users/eliteweblabs/)
 * (@eliteweblabs)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/trigger-user-switch/)
 * Hi there, I am trying to add a user switching dropdown menu to the wordpress 
   admin toolbar.
 * `$nonce_url = wp_nonce_url(site_url().'/wp-login.php?action=switch_to_user&user_id
   ='.$user->ID);`
 * however when I click on it, I get wordpress failure notice,
    Are you sure you
   want to do this? Please try again.
 * [https://wordpress.org/plugins/user-switching/](https://wordpress.org/plugins/user-switching/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [John Blackbourn](https://wordpress.org/support/users/johnbillion/)
 * (@johnbillion)
 * WordPress Core Developer
 * [10 years, 1 month ago](https://wordpress.org/support/topic/trigger-user-switch/#post-7310234)
 * You might be interested in the [Admin Bar User Switching add-on plugin](https://wordpress.org/plugins/admin-bar-user-switching/).
   If it doesn’t quite do what you want it to do, then you can take a look at the
   code in the plugin to see the best method for outputting your own user switching
   link.

Viewing 1 replies (of 1 total)

The topic ‘Trigger User Switch’ 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: [10 years, 1 month ago](https://wordpress.org/support/topic/trigger-user-switch/#post-7310234)
 * Status: resolved