# Log In With Username Only

> Stops WordPress from accepting an email address in the login form, so only usernames work.

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

## Code

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

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

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

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Log In With Username 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/
