Skip to content

How To Hide A WordPress Plugin From Plugin List

I was recently working on a client site, which required me to create a custom plugin for his website. I wanted to hide the plugin from the user, as he was a beginner and the plugin contained some sensitive functions to run his website.

Sometimes, when your client hires you for something, and that work only requires you to install a plugin, you might want to hide that plugin from the plugin list. You won’t want your client to see that you charged him/her only for installing a plugin.

In this tutorial, I’ll show how you can easily hide a WordPress plugin from plugin list. The plugin will still work, but will not appear in the plugin list.

Just add the following snippet to your current theme’s functions.php file:

function hide_plugin_trickspanda() { global $wp_list_table; $hidearr = array('plugin-directory/plugin-file.php'); $myplugins = $wp_list_table->items; foreach ($myplugins as $key => $val) { if (in_array($key,$hidearr)) { unset($wp_list_table->items[$key]); } } } add_action('pre_current_active_plugins', 'hide_plugin_trickspanda');
Code language: PHP (php)

Replace plugin-directory/plugin-file.php in above code with your plugin’s directory and file name. You can find this info by clicking on edit plugin link from the plugin list.

If you want to hide the plugin from your WordPress Multisite, then you above snippet will not remove the plugin from the Network admin list. Here’s a snippet that will work on the WordPress Multisite

function mu_hide_plugins_network( $plugins ) { // let's hide akismet if( in_array( 'akismet/akismet.php', array_keys( $plugins ) ) ) { unset( $plugins['akismet/akismet.php'] ); } return $plugins; } add_filter( 'all_plugins', 'mu_hide_plugins_network' );
Code language: PHP (php)

I used Akismet as an example. You’d have to replace akismet/akismet.php with the directory and file name of the plugin you’re trying to hide.