# Log In With Email Address Only

> Accepts only an email address and password on the login form. Usernames are rejected, which makes guessing logins harder.

- Type: PHP
- Runs: Run everywhere
- Category: [Login](https://wpide.com/library/category/login/)
- Tags: login, email, username
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/login-with-email-only/

## Code

```php
remove_filter( 'authenticate', 'wp_authenticate_username_password', 20 );

add_filter( 'gettext', function ( $translation, $text ) {
    if ( 'Username or Email Address' === $text ) {
        return 'Email Address';
    }

    return $translation;
}, 10, 2 );
```

## Notes

Do not combine with "Log In With Username Only", or nobody will be able to log in.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Log In With Email Address Only" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
