Documentation
SwitchGuard
Troubleshooting

Troubleshooting

"Switch to" Link Not Appearing in User List

  1. Confirm Enable User Switching is set to Yes.
  2. Verify your current user has the edit_users capability (current_user_can('edit_users')).
  3. Check that the target user has a lower role level than yours.

Switch Back Not Working

  1. Check that cookies are enabled in your browser and the switchguard_origin cookie exists.
  2. If the cookie expired (> 48 hours), log in normally to restore your admin session.
  3. Clear browser cookies and log in again if the cookie data appears corrupted.

Admin Bar Indicator Not Showing

  1. Confirm your theme calls wp_head() and wp_body_open() for the admin bar to render.
  2. Check that show_admin_bar(true) is not being overridden by your theme or another plugin.
  3. 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.