How to hide WordPress plugins from clients or all users?

Have you ever wanted to hide WordPress plugins from the installed plugins list? 

If you are a freelancer or run a WordPress agency, then you may want to hide plugins from your clients. There are certain reasons behind hiding plugins for clients or a specific user role. I can mention 3 reasons that I faced while working for a client's website - 

Accidental Update:  My clients sometimes update plugins without notifying me and that sometimes breaks the website. 

Protection: Sometimes I wanted to hide a special plugin from my clients and didn’t want them to know the actual plugin name that I have used. 

Finicky Clients: I faced some clients who always question why I installed this plugin, what’s the use of that plugin, why you can’t develop something like WooCommerce for my store?

I used to install plugins, but hide some selected plugins for this type of user. 

Your reason may be different then mine, but our goal is the same, and it's to hide WordPress plugins from clients or personal websites. 

If you have any other reason, can you drop your reason in the comment box and let us (me and other readers) know about your interesting reason. 

Now you know the pros of hiding WordPress plugins, but there a major cons too. 

If you want to deactivate a plugin in the future that is hidden, you need to unhide this from your code, and then you will be able to deactivate it. Otherwise, you need to log in to your FTP or cPanel, then rename the plugin folder. 

Where there's a challenge, there's always a way forward. To resolve this plugin deactivation issue, I would like to mention the WP Spotlight plugin. You can use the Spotlight search system and deactivate or delete any active or installed plugin from your WordPress Dashboard. 

To add WP Spotlight, just navigate to Plugins> Add New and search for WP Spotlight. Install the plugin. 

Within the setup wizard you will get a keyboard shortcut to enable the spotlight search enabled in your WordPress Dashboard. For Mac it’s options + S for windows it’s Alt + S

With the help of WP Spotlight, you can navigate through your WordPress Dashboard easily and take action. 

How to hide WordPress plugins for all users? 

Just copy and paste the following code in your functions.php file (Recommend child Theme). No need to modify the code except one line 'plugin-folder/main-index-file.php', . Here plugin-folder refers the folder name of your installed plugin and main-index-file.php refers the main index file of your plugin. 

function hide_specific_plugins_adminify( $plugins ) { $plugins_to_hide = array( 'plugin-folder/main-index-file.php', // Add more plugins here if needed. ); foreach ( $plugins_to_hide as $plugin ) { if ( isset( $plugins[ $plugin ] ) ) { unset( $plugins[ $plugin ] ); } } return $plugins; } add_filter( 'all_plugins', 'hide_specific_plugins_adminify' );

For example: WooCoomerce plugins folder name is “woocommerce” and the main file is “woocommerce.php”. 

First, check the following screenshot, or you can watch the video on our Facebook page. You will get a clear idea of how to hide any WordPress plugins from your installed plugin library. In the screenshot, you can see that WooCommerce is hidden from the installed plugin page, but you can see all functionality of WooCommerce in the admin menu.

hide WordPress plugins for all users

How to hide WordPress plugins for a specific username? 

This is one of the most interesting part, you can hide any plugin for specific username. Just copy the following code and paste it inside your functions.php file. 

function hide_plugins_for_specific_user_adminify( $plugins ) { if ( ! is_admin() ) { return $plugins; } $current_user = wp_get_current_user(); if ( 'set-username' === $current_user->user_login ) { $plugins_to_hide = array( 'woocommerce/woocommerce.php', // Add additional plugins as needed. ); foreach ( $plugins_to_hide as $plugin_file ) { if ( isset( $plugins[ $plugin_file ] ) ) { unset( $plugins[ $plugin_file ] ); } } } return $plugins; } add_filter( 'all_plugins', 'hide_plugins_for_specific_user_adminify' );

Those are the two main 2 code snippets I used to hide WordPress plugins from the plugin installed page and make it suitable for my clients. 

hide WordPress plugins for a specific username

Let’s Wrap UP!

In summary, hiding WordPress plugins can reduce the plugin list and limit the exposure of internal plugins that aren’t meant for regular interaction. However, deactivating a plugin can make troubleshooting and debugging more challenging. 

Get notified about Updates & Offers

Subscribe to get Updates & Offers

You Might Also Like:

Leave a Comment

Your email address will not be published

Coupons