WordPress.org

Ready to get started?Download WordPress

Codex

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

Function Reference/wp lostpassword url

Description

This Template Tag returns the URL that allows the user to retrieve the lost password.

Usage

 <?php echo wp_lostpassword_url$redirect ); ?> 

Parameters

$redirect
(string) (optional) URL to redirect to after retrieving the lost password.
Default: None

Examples

Default Usage

<a href="<?php echo wp_lostpassword_url(); ?>" title="Lost Password">Lost Password</a>

Lost Password and Redirect to Current Page

<a href="<?php echo wp_lostpassword_url( get_permalink() ); ?>" title="Lost Password">Lost Password</a>

Lost Password and Redirect to Homepage

<a href="<?php echo wp_lostpassword_url( get_bloginfo('url') ); ?>" title="Lost Password">Lost Password</a>

Notes

Change Log

Since: 2.8.0

Source File

wp_lostpassword_url() is located in wp-includes/general-template.php.

Related

Login Tags: is_user_logged_in(), wp_login_form(), wp_loginout(), wp_logout(), wp_register()
Login URLs: wp_login_url(), wp_logout_url(), wp_lostpassword_url(), wp_registration_url()

See also index of Function Reference and index of Template Tags.