A Cozmoslabs Product
Documentation / Profile Builder Developer Knowledge Base / Messages / Alerts / Change the text for username in login and password reset

Change the text for username in login and password reset

This function will change the original text for username in login and password reset with any custom text.

Make sure to:

  • change the text in $new_text on line 7, 13, 19 and 25
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * Change the text for username in login and password reset
 */
 
function wppb_change_text_login( $translated_text, $text ) {
   $original_text = 'Invalid username.';
   $new_text = 'Invalid user ID.';
   if ( $text == $original_text ) {
      $translated_text = $new_text;
   }
 
   $original_text = 'Username';
   $new_text = 'User ID.';
   if ( $text == $original_text ) {
      $translated_text = $new_text;
   }
 
   $original_text = 'Please enter your username or email address.';
   $new_text = 'Please enter your user ID or email address.';
   if ( $text == $original_text ) {
      $translated_text = $new_text;
   }
 
   $original_text = 'Username or Email';
   $new_text = 'User ID or Email';
   if ( $text == $original_text ) {
      $translated_text = $new_text;
   }
   return $translated_text;
}
add_filter( 'gettext', 'wppb_change_text_login', 30, 3 );

The Ultimate Membership Bundle

Combine the power of Profile Builder with Paid Member Subscriptions to set up user registration, memberships, and recurring revenue.

Get 25% off with the bundle

Help & Support

We’re here to help you every step of the way.

Open a Support Ticket