WordPress.org

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Filter Reference/lostpassword redirect

The lostpassword_redirect filter is used to change the location redirected to after a user requests a password reset. This could be the location set by the "redirect_to" parameter sent to the forgot password page.

Parameters

$lostpassword_redirect
(string) (required) The redirect destination URL.
Default: None

Examples

This simple example will redirect a user to the home_url() upon successful password reset.

add_filter( 'lostpassword_redirect', 'my_redirect_home' );
function my_redirect_home( $lostpassword_redirect ) {
	return home_url();
}

Notes

This filter is to redirect the user following reset of the password. To filter the location of the password reset itself, use lostpassword_url

Changelog

Since: 3.0

Source File

lostpassword_redirect is located in wp-login.php

Related