How to redirect users to a custom welcome page after logging in Woocommerce?

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.

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.

woocommerce

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:

woocommerce

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.

woocommerce

After successfully logging in user will be redirected to the custom welcome page.

woocommerce

CHEERS J

Waqas

I hope you enjoy reading this blog post. If you want my team to do WooCommerce Maintenance for you, click here.

Leave a Comment

Your email address will not be published. Required fields are marked *