WordPress filter hook

lostpassword_redirect

Fired by 12 WordPress plugins, running on 354K+ sites between them.

“Filters the URL redirected to after submitting the lostpassword/retrievepassword form.”

How to use lostpassword_redirect

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'lostpassword_redirect', function( $lostpassword_redirect ) {
	// Change $lostpassword_redirect here.
	return $lostpassword_redirect;
}, 10, 1 );

Argument names come from WP 2FA's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

12 plugins that fire lostpassword_redirect

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. LoginPress icon LoginPress200,000+ installs apply_filters( 'lostpassword_redirect', $loginpress_lostpassword_redirect ) include/template-loginpress.php:538
  2. WP 2FA icon WP 2FA100,000+ installs apply_filters( 'lostpassword_redirect', $lostpassword_redirect ) includes/classes/Authenticator/class-reset-password.php:285
  3. Theme My Login icon Theme My Login50,000+ installs apply_filters( 'lostpassword_redirect', tml_get_request_value( 'redirect_to' ) ) includes/forms.php:347
  4. Loginfy icon Loginfy2,000+ installs apply_filters( 'lostpassword_redirect', $lostpassword_redirect ) Inc/Core/Inc/loginfy-login-template.php:913
  5. School Management System icon School Management System1,000+ installs apply_filters( 'lostpassword_redirect', $lostpassword_redirect ) wpsp-school-login.php:459
  6. Login Page Customizer icon Login Page Customizer1,000+ installs apply_filters( 'lostpassword_redirect', $lostpassword_redirect ) login-page-customizer/customize/template-lpc-custom-login-page.php:423
  7. WP Front End Login icon WP Front End Login10+ installs apply_filters( 'lostpassword_redirect', $lostpassword_redirect ) wp-front-end-login.php:566
  8. CubeAccount Frontend Login icon CubeAccount Frontend Login10+ installs apply_filters( 'lostpassword_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' ) cubeacct_page_account.php:84
  9. SignInForge icon SignInForgeFewer than 10 installs apply_filters( 'lostpassword_redirect', $requested ) src/Redirects/RedirectResolver.php:121
  10. Dashboard Plus icon Dashboard PlusFewer than 10 installs apply_filters( 'lostpassword_redirect', $lostpassword_redirect ) modules/customizer/templates/dashplu-login-page.php:877
  11. JAT Site Shield icon JAT Site ShieldFewer than 10 installs apply_filters( 'lostpassword_redirect', $redirect_to ) includes/modules/class-login-protection.php:319
  12. Gutenberg Login Page Customizer icon Gutenberg Login Page CustomizerFewer than 10 installs apply_filters( 'lostpassword_redirect', $redirect ) blocks/lost-password/block.php:170

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.