Smart Redirect
After switching, SwitchGuard redirects the browser to an appropriate page based on the target user's role, so you immediately see the most relevant interface for that user's context.
Redirect Map
| Target Role | Redirect Destination |
|---|---|
| Customer (WooCommerce) | WooCommerce My Account page |
| Subscriber | Site home page |
| Contributor / Author | WordPress dashboard |
| Editor | WordPress dashboard |
| Administrator | WordPress dashboard |
Custom Redirects
If you have custom roles not in the standard hierarchy, you can override the redirect destination using the switchguard_redirect_url filter:
add_filter( 'switchguard_redirect_url', function( $url, $target_user ) {
if ( in_array( 'custom_role', $target_user->roles ) ) {
return home_url( '/custom-dashboard/' );
}
return $url;
}, 10, 2 );