1

enter image description here

I would like to replace "Username" in the Wordpress login form with another word. How do I go about doing that?

1 Answer 1

1

You can use the gettext filter:

/** * Rename the 'Username' label in wp-login.php * * @see http://wordpress.stackexchange.com/a/159507/26350 */ add_filter( 'wp_login_errors', function( $errors ) { add_filter( 'gettext', 'wpse_change_username', 99, 3 ); return $errors; } ); function wpse_change_username( $translated_text, $untranslated_text, $domain ) { $old = "Username"; $new = "Jediname"; if ( $untranslated_text === $old ) $translated_text = $new; remove_filter( current_filter(), __FUNCTION__ ); return $translated_text; } 

where we hook into the wp_login_errors, which is very close to the username input.

Here's a screenshot:

Username->Jediname

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.