Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How can i allow users to login to my wordpress site using both email id and username? Currently it is allowing only username.

share|improve this question
Sorry, plugin/theme recommendations are off topic here. Try the WordPress group on Google+ or forums – Bainternet Mar 11 '13 at 13:21

2 Answers 2

up vote 4 down vote accepted

Here you got a small plugin. If you don't (or can't) use a plugin, this should - in theory - as well work from within your functions.php file. Just leave the plugin comment header out.

/** Plugin Name: (#90328) Login with E-Mail address */
function login_with_email_address( &$username ) {
    $user = get_user_by( 'email', $username );
    if ( !empty( $user->user_login ) )
        $username = $user->user_login;
    return $username;
add_action( 'wp_authenticate','login_with_email_address' );

Hope this helps.

share|improve this answer
I edited your question as this is plugin territory and shouldn't be part of a theme. I left your statement in, but offered it as plugin as well. – kaiser Mar 11 '13 at 13:25

There is an installable plugin for this

share|improve this answer
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review – birgire Nov 10 at 14:30
Also, you must disclose your affiliation in answers like this. It appears to be your plugin, so your answer should reflect that. – Gabriel Nov 10 at 14:45

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.