1

The “Lost your password?” link on the standard WordPress login screen (wp-login) links to /shop/my-account/lost-password/ instead of the WP standard (wp-login.php?action=lostpassword). My website is the following: www.lazonemph.com

I use Members plugin and Wocommerce..

1) How do I set this back to the WP password page? Because right now my user can't reset their password since the lost/password page is blocked by the members plugin. This link works fine: https://lazonemph.com/wp-login.php?action=lostpassword

Can you help me with that please? Thank you!

2
  • you can change the link on the login page with this fliter : codex.wordpress.org/Plugin_API/Filter_Reference/…
    – mmm
    Jan 12, 2018 at 13:34
  • I tried that filter and it has not effect on the 'Forgot your password'-URL on the login-screen. I'm in the same situation. One could argue that this is a WooCommerce-question, since it's related to that and therefore off-topic. I would argue that it is a WordPress-question, to be able to spot which filter can change the URL of the 'Lost Password'-link.
    – Zeth
    Sep 21, 2021 at 12:09

2 Answers 2

1
+50

Please Add Below Code To Your Active theme's functions.php file:

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

Or Try in .htaccess

Redirect 301 /shop/my-account/lost-password/ /wp-login.php?action=lostpassword

Or Else you can also do with Cloudflare, If you're using it

Hope this helps you...

2
  • That doesn't do anything. What's extra-wierd is that if I write die() inside my functions.php-file, then the login-page loads and renders as it should (so hooks written in there doesn't affect the login-page). Something tells me that this has to be done in a file or something.
    – Zeth
    Sep 21, 2021 at 12:35
  • @Zeth I have edited the My Answer
    – Mr SKT
    Sep 22, 2021 at 1:10
0

TL;DR

Remove lost-password under Woocommerce >> Advanced >> Account Endpoints.

Remember to clear your cache, if you have that enabled.


Comment

The solution found in this post

As I wrote in the comment, then nothing happend, when I added stuff to my functions.php-file and reloaded the login-page. So I'm not sure what is with all those 'add_filter`-functions, which is to be found all over the place.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.