admin管理员组

文章数量:1298178

My lost password option in the wp login page redirect to woocommerce lost password page.How to set it back to the standard wp lost password option.?I want it to redirect to "wp-login.php?action=lostpassword". I am using,woocommerce,paid membership pro,buddypress plugins. I found this Lost password link is redirecting to /shop/my-account/lost-password/, but I couldn't understand it.

Thanks.

My lost password option in the wp login page redirect to woocommerce lost password page.How to set it back to the standard wp lost password option.?I want it to redirect to "wp-login.php?action=lostpassword". I am using,woocommerce,paid membership pro,buddypress plugins. I found this Lost password link is redirecting to /shop/my-account/lost-password/, but I couldn't understand it.

Thanks.

Share Improve this question asked Jan 11, 2019 at 6:07 beginnerbeginner 1672 silver badges10 bronze badges
Add a comment  | 

4 Answers 4

Reset to default 3

Try to put below code into your theme functions.php file

remove_filter( 'lostpassword_url', 'wc_lostpassword_url', 10 );

OR

function reset_pass_url() {
    $siteURL = get_option('siteurl');
    return "{$siteURL}/wp-login.php?action=lostpassword";
}
add_filter( 'lostpassword_url', 'reset_pass_url', 10, 2 );

Please let me know if any query.

Hope it will help you.

You can do this without code by going to the WooCommerce administration, Settings, Advanced, and removing the "lost-password" text from the Lost password field under Account Endpoints:

You can remove the filter that WooCommerce uses to replace the lost password URL like so:

remove_filter( 'lostpassword_url', 'wc_lostpassword_url', 10 );

You can try this code:

function wdm_lostpassword_url() {
  return site_url( '/wp-login.php?action=lostpassword' );
}
add_filter( 'lostpassword_url', 'wdm_lostpassword_url', 10, 0 );

Add it to to your current active theme's functions.php file

本文标签: