Documentation
SwitchGuard
Overview

WindCodex SwitchGuard

Overview

WindCodex SwitchGuard lets administrators switch into any user account with a single click - without knowing the user's password. When you switch, you see exactly what that user sees and can interact with the site as them. A persistent admin bar indicator reminds you that you are switched, and switching back is one click away.

How It Works

Admin User

    ├-- Clicks "Switch to" in user list / order screen / profile


SwitchGuard validates:
  ✓ Current user has edit_users capability
  ✓ Target user is a lower role level
  ✓ Block admin targets setting (if enabled)


Secure cookie set: switchguard_origin
  (HMAC-signed with admin user ID + expiry)


Logged in as target user
  ← Admin bar shows "Switching as [username]" + Switch Back button


Admin clicks "Switch Back"


Cookie validated → Original admin session restored → Cookie cleared

SwitchGuard does not require WooCommerce but integrates with it if present (Order screen switch button).


Requirements

RequirementMinimum
WordPress6.0
PHP8.1
WooCommerce (optional)7.0+ for order-screen integration