Comments 1Ben Hamman started the conversationMarch 19, 2021 at 11:54amHi,Currently, when a user logins in through the force login screen they are directed to their account dashboard, is there a way to direct them to the homepage of the website instead?Thanks,Ben 2,619WebWizards repliedMarch 19, 2021 at 6:41pmHi Ben,I believe you can do it by adding this code snippet to your site: add_action('woocommerce_login_redirect', function($url){ $url = get_home_url(); // for shop url use $url = get_permalink( wc_get_page_id( 'shop' ) ) return $url; } Kind regards,Stefan 1Ben Hamman repliedMarch 22, 2021 at 10:15amThis has worked perfectly.Thank you, Stefan!1 Like Ben Hamman replied privately WebWizards replied privately Sign in to reply ...
Hi,
Currently, when a user logins in through the force login screen they are directed to their account dashboard, is there a way to direct them to the homepage of the website instead?
Thanks,
Ben
Hi Ben,
I believe you can do it by adding this code snippet to your site:
add_action('woocommerce_login_redirect', function($url){ $url = get_home_url(); // for shop url use $url = get_permalink( wc_get_page_id( 'shop' ) ) return $url; }Kind regards,
Stefan
This has worked perfectly.
Thank you, Stefan!