# Hide Plugins From the Plugins Screen

> Hides chosen plugins from the Plugins screen for everyone except the users you name, so clients do not deactivate them by accident.

- Type: PHP
- Runs: Admin only
- Category: [Admin](https://wpide.com/library/category/admin/)
- Tags: admin, plugins, client
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/hide-plugins-from-list/

## Code

```php
// Plugin files to hide (folder/main-file.php, as shown in the plugin's edit link).
$wpide_hidden_plugins = array( 'hello.php' );

// Usernames that still see every plugin.
$wpide_plugins_visible_to = array( 'admin' );

add_filter( 'all_plugins', function ( $plugins ) use ( $wpide_hidden_plugins, $wpide_plugins_visible_to ) {
    $user = wp_get_current_user();

    if ( in_array( $user->user_login, $wpide_plugins_visible_to, true ) ) {
        return $plugins;
    }

    foreach ( $wpide_hidden_plugins as $file ) {
        unset( $plugins[ $file ] );
    }

    return $plugins;
} );
```

## Notes

Hidden plugins keep running, so pair this with blocking plugin installs on client sites.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Hide Plugins From the Plugins Screen" 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/
