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 following snippet to your current theme’s functions.php file:

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 wanna 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 which will work on the WordPress Multisite

44 thoughts on “How To Hide A WordPress Plugin From Plugin List”

  1. The problem with the child-theme approach is that there isn’t always one present, so that would mean creating and installing one first. I would much rather SSH in and be able to drop something quickly into mu-plugins, or something similar. Wouldn’t you?

  2. Yes, I thought so too. In fact I thought all I would need to do is top and tail “” but the code doesn’t seem to want to work as an mu-plugin. Any idea why it wouldn’t work?

    1. I can’t help with that issue cuz I never really used WordPress Network for a personal project to fork the plugin and all that stuff.

      Just try to point to the directory where the plugin file is located and it should work :)

  3. The code did not work in wordpress single site…so I modified it to work correctly

    /* JULIAN CODE */
    function hide_plugin_trickspanda()
    {
    global $wp_list_table;
    $hidearr = array(WP_PLUGIN_DIR.’folder/executable.php’);

    $myplugins = $wp_list_table->items;

    foreach ($myplugins as $key => $val)
    {
    $Tool = ‘wats/wats.php’;
    echo’alert(“‘.$key.'”);’;
    echo’alert(“‘.$Tool.'”);’;

    if($Tool == $key)
    {
    unset($wp_list_table->items[$key]);
    }

    }

    }

    add_action(‘pre_current_active_plugins’, ‘hide_plugin_trickspanda’);

    /*END*/

          1. Okay… I installed it… It can only hide core, updates, themes etc. Not single plugin
            Lets say I have a “Peter-Coded” plugin that I don’t want him to see anywhere – For my eyes only?
            I don’t want to prevent him from all the “normal” admin stuff (He is not suppose to realise that I am hiding my plugin for him). And other admins ( we are five) wont be abel to see or copy my code.

          2. Then you can hide the plugins from the list using this snippet + you can use a role managing plugin to grant/revoke some access from him, such as updating plugins and all.

  4. Me again … If I have two or more plugins to add…? Can I add them in th Array? like this:

    function hide_plugin_trickspanda() {
    global $wp_list_table;
    $hidearr = array(‘plugin-directory1/plugin-file1.php,plugin-directory2/plugin-file2.php,plugin-directory3/plugin-file3.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’);

    Or do I create a function hide_plugin2_trickmefast()

    :-)

    1. wordpress\wp-content\themes\minezine

      in ‘ functions.php ‘ where should exactly add this code ?
      should I change something more on Code?

      function hide_plugin_trickspanda() {
      global $wp_list_table;
      $hidearr=array();
      $hidearr[] = array(‘restrict-categories/restrict-categories.php’);
      $hidearr[] = array(‘role-scoper/role-scoper.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’);

      Thank you!

        1. I added the code but the plugin ‘JigoShop’ still on the left bar …
          please help

          function hide_plugin_trickspanda() {
          global $wp_list_table;
          $hidearr=array();
          $hdiearr[] = array(‘jigoshop/jigoshop.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’);
          ?>

          1. Sure,

            here’s http://pastebin.com/iMzUgr4M

            Btw, I am trying to make a Multiside webpage that each user may have their own profile where they can see only their own posts, pages,

            i tried some code but it did not work

            please help
            Thank u very much in advance,

          2. Sorry for late reply but a friend of mine passed away so I was busy with his funeral and services.

            I see the error in your code, which is a minor error.

            Replace:

            $hidearr[] = array(‘jigoshop/jigoshop.php’);

            with:

            $hidearr[] = array('jigoshop/jigoshop.php');

  5. Hi Hardeep! Thank you for the code, it works!

    But it works only for a single plugin, How can I hide two or more plugins, I have seen one comments and you have listed a solution to use $hidearr = array();
    $hidearr[] = array(‘plugin-directory/plugin-file.php’);
    $hidearr[] = array(‘plugin-directory/plugin-file.php’);

    But that doesnt work,

    Can you pass me the full code?

    Thank you in advance!

  6. Hi,

    I have different question when are under chrome and click F12 you have developer mode. Now under Sources-sources->yourwebsite you can see list of current plugin.
    Do you know how to remove this list. Everyone can see what plugins are in use ?

    Regards,
    Radek

  7. Hey,

    Thanks for this.

    The second snippet works when I add it to functions, but it doesnt work when I add it to a mu-plugin in wp-content/plugins/mu-plugins/filename.php or wp-content/mu-plugins/filename.php

    Any ideas on how to get it working in a MU plugin?

    Thanks a lot.

Leave a Comment