I want to write a plugin hook for wp-login.php?action=lostpassword.

Does anyone know what the add_action() is for wp-login.php?action=lostpassword?

I searched the CODEX and could not discover it.

Thank you.


The login form actions are located in wp-login.php here and here.

// "login_form_{$action}"


There's also the general login_init which will fire for all actions.

To enqueue scripts on login, use login_enqueue_scripts. Right after that, login_head will allow you to add custom meta tags, etc. to the <head>.

The end of the page is injectable with login_footer.

  • If you need to adjust (or add) errors, use lostpassword_post, which comes with an argument \WP_Error $errors.
  • If it's about passwords, you can use validate_password_reset which has two arguments, first again the \WP_Error $errors and the current \WP_User $user as second (or another \WP_Error in case the user is errornous).
  • 1
    @tammy - there are a few more I've added above.
    – Milo
    Oct 11 '15 at 21:07
  • Thank you very much @Milo. login_init is exactly what I was looking for.
    – tammy
    Oct 11 '15 at 21:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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