Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WooCommerce - Redirecting a User after They've Reset Their Password

I'm setting up a WooCommerce shop for a client and he has requested that the user be redirected back to the login form after the reset password form has been submitted.

Is this possible? Which function controls this?

Thanks in advance.

like image 680
Daniel Kilburn Avatar asked Oct 14 '25 16:10

Daniel Kilburn


1 Answers

A much cleaner solution is to redirect using the woocommerce_customer_reset_password action:

function woocommerce_new_pass_redirect( $user ) {
  wp_redirect( get_permalink(woocommerce_get_page_id('myaccount')));
  exit;
}

add_action( 'woocommerce_customer_reset_password', 'woocommerce_new_pass_redirect' );

This code can be placed in functions.php.

like image 188
Mauricio Ulloa Avatar answered Oct 18 '25 00:10

Mauricio Ulloa