1

I would like to redirect the default wordpress password reset url /end-point. So the url before the password is reset.

/wp-login.php?action=lostpassword

redirect to /password-reset/ (which is aalready setup)

I have created a custom page, so any user querying the old url will be redirected to the new page.

0

1 Answer 1

4

There is a filter to change the lost password url. Try this :

add_filter( 'lostpassword_url',  'my_lostpassword_url', 10, 0 );
function my_lostpassword_url() {
    return site_url('/password-reset/');
}

Note : You can place code in functions.php or make plugin (Recommended).

3
  • Thank you very much! This change the global hook and works. My only issue is that if anything else references the old url, then i need that to redirect.
    – Stefano
    Commented Dec 6, 2016 at 10:22
  • As I understand now,You want redirect if some one access url it go to new url Commented Dec 6, 2016 at 10:23
  • @Stefano Please use this plugin : wordpress.org/plugins/redirection Commented Dec 6, 2016 at 10:26