We’ve a WoordPress with WooCommerce (which we are not using at the moment, but don’t want to get rid of), and when users sign up and follow the set up password instructions, they end up in oursite.com/wp-login.php
.
The problem comes when they log in, because they’re automatically redirected to WooComerce’s My Account page. We would like to take users to a different page.
Is it possible to disable this WooCommerce functionality? Choose a different page or even go to the homepage instead?
Thanks!
4
Answers
Solved, although I still don't understand the "architecture" of it...
Why do I have to force the redirection using an extra hook in my functions file, instead of disabling WooCommerce's behaviour?
Anyway :)
I would use this to redirect a user to the home page:
WooCommerce has two hooks for redirect after registration and login:
UPDATE
This code is also used to change the
wp-admin/wp-login.php
redirect:Code goes in
functions.php
file of your active theme/child theme. Tesed and works.WooCommerce uses this filter to force redirect customers to my-account page
woocommerce_prevent_admin_access
, so you need to pass false to this filter to disable the woocommerce redirectYou can then use
login_redirect
filter after that to customize the wordpress redirect link after login