Redirecting to a custom forgot password page

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

Topic reset password php Wordpress

Category Web


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.org/reference/

An example from here: https://codex.wordpress.org/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" );
    }

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.