In Woocommerce, when a user / customer logs in it will redirect user to shop page.
In this tutorial, we’ll learn how to redirect customers / users to a custom welcome page.
Our team at Themelocation is comprised of WordPress developers of high expertise
- We can maintain, support and manage your single, or all your clients, website with dedication
- Our skills are at your disposal.
To do this first of all add a custom thank you page from the backend of your site by clicking on add new link under pages.
Now add the following lines of code at the end of your theme’s functions.php file:
functionwc_custom_user_redirect( $redirect, $user ) { return "http://localhost/wordpress/?page_id=79"; } add_filter( 'woocommerce_login_redirect', 'wc_custom_user_redirect', 10, 2 );
You can access functions.php file here:
Replace the url in code with the url of your custom welcome page where you want users to redirect after logging in.
Now go to your site and sign in using an existing account.
After successfully logging in user will be redirected to the custom welcome page.
CHEERS J