Title: Switch back button (for your theme template)
Last modified: February 1, 2021

---

# Switch back button (for your theme template)

 *  Resolved [devgmcom](https://wordpress.org/support/users/devgmcom/)
 * (@devgmcom)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/switch-back-button-for-your-theme-template/)
 * This is if you want to put a link for the users to switch back to the previous
   or old user – so you don’t have to waste your time.
 *     ```
       <?php
       $old_user = user_switching::get_old_user(); if ( $old_user ) {   
       $link = user_switching::switch_back_url($old_user ); 
       ?> 
        <a href="<?php echo $link; ?>" class="dropdown-item">
        <i class="fa fa-arrow-left text-primary"></i> 
        Switch Back
        </a> 
       <?php }  ?>
       ```
   
 * (drop me if I helped you ty)
 * ETH:
    0x18fF646c9d41361fCE2d0B25f55D1Ea5843e07f6 BTC: 38CYJEz87oFsCDSK3kpxmuZWzua3QkqWuj

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

 *  Plugin Author [John Blackbourn](https://wordpress.org/support/users/johnbillion/)
 * (@johnbillion)
 * WordPress Core Developer
 * [5 years, 4 months ago](https://wordpress.org/support/topic/switch-back-button-for-your-theme-template/#post-13984934)
 * Thanks for the post! This is already covered in the FAQ: [https://wordpress.org/plugins/user-switching/#can%20i%20add%20a%20custom%20%22switch%20to%22%20link%20to%20my%20own%20plugin%20or%20theme%3F](https://wordpress.org/plugins/user-switching/#can%20i%20add%20a%20custom%20%22switch%20to%22%20link%20to%20my%20own%20plugin%20or%20theme%3F)
 *  Plugin Author [John Blackbourn](https://wordpress.org/support/users/johnbillion/)
 * (@johnbillion)
 * WordPress Core Developer
 * [5 years, 4 months ago](https://wordpress.org/support/topic/switch-back-button-for-your-theme-template/#post-13984943)
 * Oh apologies, the FAQ item doesn’t cover switching back. I’ll get it updated 
   with your code example.

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

The topic ‘Switch back button (for your theme template)’ 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/)

 * 2 replies
 * 2 participants
 * Last reply from: [John Blackbourn](https://wordpress.org/support/users/johnbillion/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/switch-back-button-for-your-theme-template/#post-13984943)
 * Status: resolved