WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to redirect users to custom lostpassword page when they click on the Error: Lost your password?. Because I set a redirect for wp-login.php to my custom login page. when a user click on Error: Lost your password? it requests for wp-login.php and then automatically redirects to custom login page. I know the function is present on wp-login.php file but I don't know what changes shall I make to make this possible. Please help. I have also renamed wp-login.php.

share|improve this question
Did you see this wordpress.stackexchange.com/questions/22310/… – Brad Dalton Feb 6 '14 at 13:53
Thanks Brad. I will certainly try this. – user3187719 Feb 6 '14 at 13:59
It worked thanks Brad for helping me again. – user3187719 Feb 6 '14 at 15:42
up vote 0 down vote accepted

If you only want to adjust the link of the lost password page, then there is a designated filter for that:

function wpse_133647_custom_lost_password_page() {
    return home_url('/lost-password');
} // function wpse_133647_custom_lost_password_page
add_filter('lostpassword_url', 'wpse_133647_custom_lost_password_page');
share|improve this answer
Thanks for your reply I used this code to redirect add_action('init','possibly_redirect'); function possibly_redirect(){ global $pagenow; if( 'wp-login.php' == $pagenow ) { wp_redirect('http://mydomain.com/login'); exit(); } } can please tell me what changes shall I make. I am a newbie to PHP and wordpress. Please help me. – user3187719 Feb 6 '14 at 14:05
What you have to do depends on what you want to do. If you want to provide your users a custom login page as well as a custom lost password, your implementation looks different from the one for using a custom login page and the default page for lost password. So what is it that you want to do? – tfrommen Feb 6 '14 at 14:09
I want custom login page and custom lostpassword page. Actually I am using theme my login plugin. But after using rename wp-login plugin I have to manually redirect. So I want custom login page and custom lostpassword page. Please help. – user3187719 Feb 6 '14 at 14:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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