The WooCommerce My Account login form redirects to… itself once a WordPress user logs in. So, what if you want to redirect logged in users to another page or a different My Account endpoint?
Also, when you have a custom Login page, you may need to redirect users to the… My Account page!
Either way, here’s how to change the default redirect behavior. Enjoy!
PHP Snippet: Redirect Logins to Custom URL @ My Account Page
/**
* @snippet Custom Redirect for Logins @ WooCommerce My Account
* @how-to businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 6
* @community https://businessbloomer.com/club/
*/
add_filter( 'woocommerce_login_redirect', 'bbloomer_customer_login_redirect', 9999 );
function bbloomer_customer_login_redirect( $redirect_url ) {
$redirect_url = '/shop';
return $redirect_url;
}
Hello, i have a problem that yo maybe able to fix, i have a custom log in page, but when people go to mysite.com/account page set it with the woocommerce_account shortcode, and they are logout redirect to the woocommerce log in not the custom one that i create. i want that people alway sign in in my custome pages and custom form.
Hello Danilo, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
It worked, many thanks!
Great!
No, it is not working.
Thanks for your feedback. Please temporarily disable all plugins except WooCommerce and try again. Let me know