Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

reset password label text change

If we want to have the reset password form to look like this:

reset

then we could use the following hooks:

/**
 * Modify the password hint
 */
add_filter( 'password_hint', function( $hint )
{
  return __( 'Use upper and lower case letters, numbers, and symbols like ! " ? $ % ^ & ).' );
} );

/**
 * Modify 'New password' text
 */
add_action( 'validate_password_reset', function( $errors )
{
    add_filter( 'gettext', 'wpse_gettext', 10, 2 ); 
    return $message;
});


/**
 * Modify 'Log in' text
 */
add_action( 'resetpass_form', function()
{
    add_filter( 'gettext', 'wpse_gettext', 10, 2 ); 
});

The wpse_gettext helper function is defined as:

function wpse_gettext( $translated_text, $text )
{
    // Modify gettext if there's a match
    switch ( $text )
    {
        case 'New password' :           
            remove_filter( current_filter(), __FUNCTION__ );
            $translated_text = __( 'Use this password, or type a new one over it' );
            break;
        case 'Log in' :
            remove_filter( current_filter(), __FUNCTION__ );
            $translated_text = __( 'Already registered before? Click here to log-in' );
            $match = true;          
        default:
    }  
    return $translated_text;
} 

where we remove the filter callback as soon as it has been used once.

We also try to hook into nearby hooks to minimize the number of gettext checks.

Also note the danger of using gettext functions within the gettext filter 😉

That’s why I moved the remove_filter above the __() calls, to avoid infinite loops.

Related Posts:

  1. Disable Or Redirect WP-login.php
  2. wordpress redirect after password reset
  3. login_enqueue_scripts does not ovewrite the default styles
  4. Modify wp-login.php labels: Username to Email
  5. How to change “Registration complete. Please check your e-mail.” in wp-login.php
  6. How to use wp-login.php page only for logout?
  7. change register url on wp-login page
  8. Can’t access wp-admin
  9. How do you add a custom link to the wordpress login page?
  10. wp-login.php register/lost password links to buttons?
  11. How to trigger a login form notice message?
  12. A child theme version of wp-login
  13. Add text on wordpress admin login page
  14. Is it possible to remove the version number from the wp-login.php page?
  15. wp_login_form() redirect not redirecting users < admin
  16. Login redirect on wp theme
  17. Can’t log in. Log in button missing [closed]
  18. Require WP login for outside access
  19. Modify WP-Login Page With Javascript?
  20. if username or password is incorrect wp-login returns a blank page
  21. Where is the email content for retrieve_password_message stored?
  22. What is the CODEX intercept for wp-login.php?action=lostpassword
  23. Call header and footer on login page
  24. Prevent redirect on custom wordpress login form
  25. Replace standard Login and Register form for Woocommerce [closed]
  26. How to destroy sessions after a user logout [closed]
  27. How to add required attribute to wp_login_form fields?
  28. WordPress “remember me” – How should it work?
  29. Changing the title of “
  30. Log In & Log Out Code In Header
  31. How to fix Sign In option in WordPress
  32. How can I redirect on a url after successful registration?
  33. I lock the site’s contents, click on a post, redirect to login, enter uname+password but fail to redirect to article
  34. How to access the actual input html of the login form
  35. Creating a custom login on site.
  36. Login page wordpress tagline remove [duplicate]
  37. Adding line break in esc_html__
  38. Copying My account/Login/Register button outside header
  39. Issue with cookies in wp-login
  40. Add content in wp login page
  41. Is it possible to check if password is correct in wp_authenticate_user?
  42. Modify login page after clicking “login” button, and before it arrives at redirect
  43. How to enable “remember me” checkbox in login forms by default?
  44. custom login query for custom login form?
  45. WordPress reCAPTCHA Problem
  46. Customizing WordPress Login URL
  47. It is possible that to get data in wp_login.php to your own php file in wordpress?
  48. Using gettext on wp-login.php won’t change “Back to site name” text
  49. Add video to wordpress login page
  50. WordPress login form with fancybox
  51. I wanna create a custom login form template
  52. Add custom field in wp_login_form()
  53. Retrieve password only by login. Users with same email
  54. wp-login.php not returning error messages / or gives 404
  55. Registration page background color covering 1 screen not covering full page
  56. Custom error messages for login and lost password forms
  57. How to Disable Pre-population of Password on Password Reset
  58. WordPress does not allow me to login until another dashboard is open
  59. Customize WordPress Password-Reset Behavior
  60. How to reset a form using jQuery with .reset() method
  61. How to reset a form using jQuery with .reset() method
  62. How to have an anim gif on a link and play it on hover and reset
  63. Resetting post data to previous loop in nested loops
  64. How can I redirect user after entering wrong password?
  65. Unable to login and wp-login.php redirects to wp-admin%2F&reauth=1?
  66. Disable user registration password email
  67. Check for correct username on custom login form
  68. The website cannot display the page
  69. Reset positions of metaboxes in admin
  70. Missing URL in password reset email
  71. Custom login form
  72. How do I create a password reset link?
  73. Email user when password is reset by admin
  74. Prevent wp_login_form() from redirecting to wp-admin when there are errors
  75. Adding “Remember Me” in custom login
  76. How do I change the language of only the login page?
  77. Disable WordPress 3.6 idle logout / login modal window / session expiration
  78. get post type plural
  79. Change Login URL Without Plugin
  80. Where should you reset postdata?
  81. Avoid to load default WP styles in login screen
  82. How to fake a WordPress login?
  83. How build a custom login/register form with error handling?
  84. Can not login with correct username and password
  85. Custom ReCaptcha Login
  86. How can I add a custom script to footer of login page?
  87. Custom login form redirect to external site
  88. How to keep always logged in development environment
  89. adding rewrite rules in .htaccess
  90. How to get the singular name of a custom taxonomy?
  91. Is there a way to set singular/plural labels for taxonomy term names?
  92. Clarification on auth_redirect()
  93. WordPress AJAX Login Screen
  94. Logout/login redirect CSS issue
  95. Multi-steps WordPress registration : in 4 steps how to?
  96. I want to disable E-Mail verifcation / activation when a user signs up for my WordPress site
  97. custom login page redirect to logged in user profile page
  98. How to redirect all requests to wp-login.php?
  99. How can I modify the default reset (lost) password email text?
  100. WooCommerce changes lost password reset link
Categories wp-login-form Tags labels, Reset, wp-login-form
Display meta box on front end
Custom field value not saving when it contains a URL?

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress