Troubleshooting
"Switch to" Link Not Appearing in User List
- Confirm Enable User Switching is set to Yes.
- Verify your current user has the
edit_userscapability (current_user_can('edit_users')). - Check that the target user has a lower role level than yours.
Switch Back Not Working
- Check that cookies are enabled in your browser and the
switchguard_origincookie exists. - If the cookie expired (> 48 hours), log in normally to restore your admin session.
- Clear browser cookies and log in again if the cookie data appears corrupted.
Admin Bar Indicator Not Showing
- Confirm your theme calls
wp_head()andwp_body_open()for the admin bar to render. - Check that
show_admin_bar(true)is not being overridden by your theme or another plugin. - Admin bar controls are only shown when switched; verify a switch is actually active.
Redirect After Switch Goes to Wrong Page
The smart redirect logic is based on the target user's primary role. If you have custom roles not in the standard hierarchy, add them to the map using the switchguard_redirect_url filter.
Enable the switchguard_switched action hook in your functions.php to log all switch events for debugging.