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. How can I redirect user after entering wrong password?
  60. How do I change the language of only the login page?
  61. get post type plural
  62. custom login page redirect to logged in user profile page
  63. When should you use wp_reset_postdata vs wp_reset_query?
  64. Change “You are now logged out” text
  65. Remove built in wordpress login and use only google auth
  66. How can I change the label “Comments” to “Review” everywhere in the WP installation without translation
  67. Customizing login error messages
  68. Change username before login
  69. Custom login form for front-end user as well as admin
  70. Use translated taxonomy labels in plugin
  71. Is possible to allow user to login with different role?
  72. WordPress error on log out ‘Not Permitted’ and can’t log out
  73. force login and redirect to custom login page
  74. Is wp_login_form secure on a non secure page?
  75. Enqueue stylesheet in plugin for wp-login.php
  76. Custom Post Types — $args vs. labels array
  77. How to change “Reset Password” text on submit button
  78. Forcing frontend login with UI switch
  79. Hiding Label via CSS
  80. Change default login auth
  81. When i try to open Localhost/wordpress/wp-admin . An Error appears ” Registration Has been Disabled” . No login page is shown in the browser
  82. How do I change the language of the login page to Arabic?
  83. Login form does not store/remember/suggest users password
  84. Admin Bar – Customizer Label Change
  85. How to set password from frontend if have activation key and user login in url in wordpress?
  86. Custom password set/reset link in same URL format as default does’t work
  87. Displaying image instead of post label in wordpress
  88. Can I use core passworded page/post functions outside of wp-login.php?
  89. WordPress wp-login.php cookie error (WordPress Version 4.2.9)
  90. Make WordPress User Name the Email Address When Register
  91. WordPress login process is hanging
  92. Redirection loop error after login from a custom post type post
  93. How to know if a tag has been added within a taxonomy?
  94. Logging in takes a few refreshes to show you are logged in, is this a cache issue? [closed]
  95. How to link that “logged in” in “you must be logged in to post a comment” with custom login page on WordPress?
  96. How to add a new link to the default register form’s footer links?
  97. WooCommerce – Checkout suddenly stops working [closed]
  98. Different customer login form than administrator login form?
  99. Why am I not able to login to the admin
  100. Can’t change login logo & css – older plugin data blocking?
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
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 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