Change Redirect URL After Switching

The View as Customer plugin includes developer hooks to customize the switching behavior.
Below are optional code snippets that developers can use to modify the redirect URL after switching into a customer account.

Use the vac_after_switch_redirect_url filter to override the redirect URL.

add_filter( 'vac_after_switch_redirect_url', function( $url, $user_id ) {
return site_url( '/shop/' ); // Redirect to Shop
}, 10, 2 );
ParameterDescription
$urlThe original redirect URL
$user_idThe customer ID being switched to

📍 Usage

Add this snippet to your theme’s functions.php file or a custom plugin.

$39.00

Billed annually

Buy Now