Change “Lost Your Password?” Text In WordPress

Quick Summary

  • A gettext filter replaces the Lost your password link text with wording such as Forgot your password, without editing core or plugin files.
  • The match is exact, including capitals and the question mark, and applies wherever that string prints, including wp-login.php and WooCommerce's My Account form.
  • The filter receives already translated text, so compare against the translated wording on non-English sites and keep the check fast.

WordPress and many plugins show a “Lost your password?” link with their login forms. To change the wording without editing core or plugin files, you can filter the text while it is being translated. The gettext filter runs for every translatable string, and this function swaps just the one you want.

Add the code to your child theme’s functions.php file.

PHP
function change_lost_your_password ($text) {
if ($text == 'Lost your password?'){
    $text = 'Forgot your password?';
 }
    return $text;
 }
add_filter( 'gettext', 'change_lost_your_password' );

How it works

  • The function compares each string with 'Lost your password?'. When it matches, it returns 'Forgot your password?'; every other string passes through unchanged.
  • Change either text to suit your site. The match is exact, including capital letters and the question mark.
  • It applies wherever that exact string is printed, for example the wp-login.php screen and the WooCommerce My Account login form.
  • The value the filter receives is the already translated text. If your site isn’t in English, compare against the translated wording instead.
  • Because gettext runs so often, keep the function to a quick comparison like this one.

See also: Email-Only Login and Strong Passwords in WordPress and WooCommerce.

Share on X (opens in a new tab) Share on LinkedIn (opens in a new tab) Share on Facebook (opens in a new tab)

ChatGPT (opens in a new tab) Claude (opens in a new tab) Gemini (opens in a new tab) Perplexity (opens in a new tab) Grok (opens in a new tab)

More Insights

See More