Remove Lost Password Text from WordPress Login

WordPress login screen, located at wp-login.php, in the WordPress root directory automatically displays text entitled “Lost your password?” This is so that people can easily locate a link to get their password, if they forgot it. If the WordPress site only has one user, you may not want the text to be displayed on the login page. Let me show you how-to remove the text from the login page.Forgot Password Text

Above: This is what the login page looks like without the text being removed.

The Code Snippet

Add the following to your theme’s functions.php file to remove the text from the WordPress login page.

 // Remove the Lost Password Text from the WordPress Login 
function remove_lostpassword_text ( $text ) { $words = "Lost your password?"; if ($text == $words){$text = '';} return $text; } add_filter( 'gettext', 'remove_lostpassword_text' );

If “Lost your password?” is not the lost your password text, you can edit the words on line two (2) of the above code snippet.

The Result

No Forgot Password Text

Above: This is what the login page will look like after the text is removed.