admin管理员组

文章数量:1332395

I have created a custom login and registration page with the plugin 'User Registration' and they both work perfectly fine, however, on the login page if I click on the ‘Forgot password’ link, it takes me to the default WordPress password reset page. Is there any way to redirect to a custom page that I have created for this purpose?

Thank you in advance.

Kind regards, Nora

I have created a custom login and registration page with the plugin 'User Registration' and they both work perfectly fine, however, on the login page if I click on the ‘Forgot password’ link, it takes me to the default WordPress password reset page. Is there any way to redirect to a custom page that I have created for this purpose?

Thank you in advance.

Kind regards, Nora

Share Improve this question asked Jul 8, 2020 at 7:52 NoraNora 1 2
  • Does this answer your question? How to change/rewrite the lost password url? – Jacob Peattie Commented Jul 8, 2020 at 8:37
  • Please share the plugin link. – Arpita Hunka Commented Jul 8, 2020 at 14:50
Add a comment  | 

1 Answer 1

Reset to default 1

Yep, there's a hook to change the lost password URL.

I found it by going to this nice page to search all the hooks and filters and selecting 'Hooks' and trying 'lost password' https://developer.wordpress/reference/

An example from here: https://codex.wordpress/Plugin_API/Filter_Reference/lostpassword_url

    add_filter( 'lostpassword_url', 'my_lost_password_page', 10, 2 );

    function my_lost_password_page( $lostpassword_url, $redirect ) {
        return home_url( "/yournew/lostpasswordpage.php" );
    }

本文标签: phpRedirecting to a custom forgot password page