• Skip to primary navigation
  • Skip to main content

RocketGeek

Home of WP-Members, The Original WordPress Membership Plugin

  • WordPress Plugins
    • WP-Members
      • FAQs
      • Quick Start
      • Documentation
      • Extensions
    • Advanced Options
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Download Protect
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Invite Codes
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • MailChimp Integration
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • PayPal Subscriptions
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Salesforce Web-to-Lead
    • Security
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Text Editor
      • Purchase the Plugin
      • Get the Pro Bundle
    • User List
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • User Tracking
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Memberships for WooCommerce
    • WordPass
  • Blog
    • Basics
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Store
    • Cart
    • Checkout
  • Contact
  • Log In
  • Show Search
Hide Search
Home » Filters » Login with Username or Email

Login with Username or Email

Chad Butler · Dec 1, 2018 ·

This article is provided free. Find out how you can get full access to premium content, including how-to articles and support forums, as well as priority email support and member exclusive plugin extensions..

 

Part of the WP-Members 3.2 project involved allowing users to log in using either their username or their email address. This makes the WP-Members Email as Username extension obsolete (which, if you’re wondering, is why it is no longer supported).

However, because all of the translation files still reflect “Username” in the login form field text, I decided to give the translators time to catch up on the language packs.  So while you can log in using either a username or an email address, the label on the form only says “Username.”  

If you would like to change that, it just requires a simple filter you can add to your theme’s functions.php file:

/**
 * The plugin currently allows login using Username OR Email but
 * the field label still reflects just username (that will be
 * changing when translators catch up on translation). In the 
 * meantime, you can change it with a couple of filters added
 * to your theme's functions.php file.
 */
add_filter( 'wpmem_inc_login_inputs', function( $defaults ) {
    $defaults[0]['name'] = "Username or Email";
    return $defaults;
});
add_filter( 'wpmem_sidebar_form', function( $html ) {
    if ( ! strpos( $html, 'Username or Email' ) ) {
        $html = str_replace( 'Username', 'Username or Email', $html );
    }
    return $html;
});

Filters wpmem_inc_login_inputs, wpmem_sidebar_form

Ready to get started?

Join Today!

© 2025 · butlerblog.com · RocketGeek is built using WordPress, WP-Members, and the Genesis Framework

  • butlerblog.com
  • WP-Members Support Subscription
  • Terms of Service
  • Privacy Policy
  • Refund Policy