# Application Passwords for Administrators Only

> Keeps Application Passwords available for administrators (for integrations and apps) but removes them for every other user.

- Type: PHP
- Runs: Run everywhere
- Category: [Security](https://wpide.com/library/category/security/)
- Tags: security, rest-api, passwords
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/application-passwords-admins-only/

## Code

```php
add_filter( 'wp_is_application_passwords_available_for_user', function ( $available, $user ) {
    return $available && $user instanceof WP_User && user_can( $user, 'manage_options' );
}, 10, 2 );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Application Passwords for Administrators 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/
