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:
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.
-
LoginPress200,000+ installs
apply_filters( 'lostpassword_redirect', $loginpress_lostpassword_redirect )include/template-loginpress.php:538 -
WP 2FA100,000+ installs
apply_filters( 'lostpassword_redirect', $lostpassword_redirect )includes/classes/Authenticator/class-reset-password.php:285 -
Theme My Login50,000+ installs
apply_filters( 'lostpassword_redirect', tml_get_request_value( 'redirect_to' ) )includes/forms.php:347 -
Loginfy2,000+ installs
apply_filters( 'lostpassword_redirect', $lostpassword_redirect )Inc/Core/Inc/loginfy-login-template.php:913 -
School Management System1,000+ installs
apply_filters( 'lostpassword_redirect', $lostpassword_redirect )wpsp-school-login.php:459 -
Login Page Customizer1,000+ installs
apply_filters( 'lostpassword_redirect', $lostpassword_redirect )login-page-customizer/customize/template-lpc-custom-login-page.php:423 -
WP Front End Login10+ installs
apply_filters( 'lostpassword_redirect', $lostpassword_redirect )wp-front-end-login.php:566 -
CubeAccount Frontend Login10+ installs
apply_filters( 'lostpassword_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' )cubeacct_page_account.php:84 -
SignInForgeFewer than 10 installs
apply_filters( 'lostpassword_redirect', $requested )src/Redirects/RedirectResolver.php:121 -
Dashboard PlusFewer than 10 installs
apply_filters( 'lostpassword_redirect', $lostpassword_redirect )modules/customizer/templates/dashplu-login-page.php:877 -
JAT Site ShieldFewer than 10 installs
apply_filters( 'lostpassword_redirect', $redirect_to )includes/modules/class-login-protection.php:319 -
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.