Title: [New Function Req.] Label change function
Last modified: December 16, 2024

---

# [New Function Req.] Label change function

 *  Resolved [chelminski](https://wordpress.org/support/users/chelminski/)
 * (@chelminski)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/new-function-req-label-change-function/)
 * Please add a function to change the label in the login form on the pages:
    - password reset,
    - login,
    - registration.
 * Allow to add your own text instead of the current one. Why is it worth it?
    - possibility of personalization (e.g. “Player name” instead of “Login or e-
      mail address”)
    - better compatibility with css (e.g. when the text “Login or e-mail address”
      is too long, you can replace it with something else, e.g. “login”)
 * Greetings
 * chelminski 😀

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [chelminski](https://wordpress.org/support/users/chelminski/)
 * (@chelminski)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/new-function-req-label-change-function/#post-18201693)
 * I tried this, but it doesn’t work perfectly and doesn’t provide the ability to
   choose which page the change occurs on. // Additional JS
 *     ```wp-block-code
       document.addEventListener("DOMContentLoaded", function() {    var label = document.querySelector('label[for="user_login"]');    if (label) {        label.textContent = "Here is changed text";    }});
       ```
   
 *  [Emma](https://wordpress.org/support/users/emma24/)
 * (@emma24)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/new-function-req-label-change-function/#post-18201785)
 * Thank you for sharing your idea with us [@chelminski](https://wordpress.org/support/users/chelminski/)!
   We have noted this as a feature request and will plan on introducing it as a 
   new feature in LoginPress.
 * Meanwhile, you can utilize this code to change the labels. Place it at the end
   of your theme’s functions.php file.
 *     ```wp-block-code
       add_filter('gettext', 'custom_login_labels', 20, 3);function custom_login_labels($translated_text, $text, $domain) {    // Customize the login form labels    if ($translated_text === 'Username or Email Address') {        $translated_text = 'Your Custom Username or Email'; // Change     }    if ($translated_text === 'Password') {        $translated_text = 'Your Custom Password'; // Change Password label    }    if ($translated_text === 'Username') {        $translated_text = 'Choose a Username'; // Change Username label    }    if ($translated_text === 'Email') {        $translated_text = 'Your Email Address'; // Change Email label    }    // Customize the lost password form labels    if ($translated_text === 'Lost your password?') {        $translated_text = 'Forgot your password?'; // Change Lost password link    }    if ($translated_text === 'Reset Password') {        $translated_text = 'Create New Password'; // Change Reset Password button text    }    return $translated_text;}
       ```
   
 * Replace the text as you want. I hope this helps!😉 Let me know if you need further
   assistance.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[New Function Req.] Label change function’ is closed to new replies.

 * ![](https://ps.w.org/loginpress/assets/icon-256x256.png?rev=3005027)
 * [LoginPress | wp-login Custom Login Page Customizer](https://wordpress.org/plugins/loginpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/loginpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/loginpress/)
 * [Active Topics](https://wordpress.org/support/plugin/loginpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/loginpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/loginpress/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Emma](https://wordpress.org/support/users/emma24/)
 * Last activity: [1 year, 5 months ago](https://wordpress.org/support/topic/new-function-req-label-change-function/#post-18201785)
 * Status: resolved