WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Would like to change

'label_username' => __( 'Username' ) on line 258 of wp-includes/general-template.php to 'label_username' => __( 'Username or Email' )

Changing core files is a not recommended --- never never

So any help to code a function to achieve this would really be appreciated.

share|improve this question
why you want to do that? we can use filter to alter a function using that variable. – amit Aug 2 '12 at 11:10

Try putting this in your functions.php

function wpse60605_change_username_label( $defaults ){
    $defaults['label_username'] = __( 'Username or Email' );
    return $defaults;
add_filter( 'login_form_defaults', 'wpse60605_change_username_label' );
share|improve this answer
Bravo! Works! and many many thanks to you and the other contributors – Valentine Cosgrave Aug 2 '12 at 11:48

You should hook to the gettext filter which is called by __() function on domain translated text with the untranslated text as second parameter.

Take a look at how to use gettext filter for changing the comment form.

share|improve this answer
thanks. going on similar type previous answers i came up with add_filter( 'gettext', 'change_label'); function change_label($translated_text){ switch ( $translated_text ) { case 'Username' : $translated_text = __( 'Username or email', 'theme_text_domain' ); break; } return $translated_text; but no go. That being said I am just a copy and paster have no real coding knowledge – Valentine Cosgrave Aug 2 '12 at 11:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.