How to redirect users after successful login to custom page?
After signing in, Vehica sends users to its own default page. These child-theme filters let you send them anywhere you like instead — with separate filters for logins made through Facebook or Google.
1 minute read
Redirect after a standard login
Please add this code to your Child Theme functions.php file (read more about child themes here) and change the https://google.com/ link to your own link.
add_filter('vehica/login/redirectUrl', function() {
return 'https://google.com';
});
Redirect after a social login
Since Vehica 1.0.57, if you use Social Login and Registration, that kind of access is handled separately — please configure it with the two filters below. One covers people who have just registered through a social account, the other every later sign-in via Facebook or Google; the placeholder URLs in the snippet show which is which. Replace both with your own links.
add_filter('vehica/socialAuth/redirectUrl', function() {
return 'https://page_for_people_who_just_registered_via_social.com';
});
add_filter('vehica/socialAuth/registered/redirectUrl', function() {
return 'https://page_for_all_next_entrace_via_facebook_or_google.com';
});
Keep reading
Ask the people who build Vehica
We answer by email from support@tangiblewp.com. With Premium Support, we also fix your site when something breaks.
We can also run your site for you, or build a new one.
Was this guide helpful?