Skip to content

How to Hide a Plugin From the WordPress Plugins List

Updated October 2026 by Marius: rewritten for current WordPress and tested on WordPress 7.1. Originally published by Hardeep Asrani in 2014.

Sometimes a plugin has to keep running without showing up under Plugins, for example a small custom plugin that a client site depends on, or a plugin a client keeps deactivating “to see if it helps”. WordPress has a filter for exactly this.

Hide a plugin from the Plugins screen

add_filter( 'all_plugins', function ( $plugins ) {
	unset( $plugins['akismet/akismet.php'] );
	return $plugins;
} );Code language: PHP (php)

The plugin keeps running; it is only left out of the list. The All and Active counts at the top of the screen go down by one as well, so nothing looks off. The same filter feeds the plugin list in Network Admin > Plugins, so it works on Multisite too.

Find the plugin’s file name

The key in the array is the plugin’s folder and main file, such as akismet/akismet.php. To find it, hover over the plugin’s Activate or Deactivate link on the Plugins screen: the link contains plugin=akismet%2Fakismet.php, where %2F is the slash. A plugin that is a single file has no folder, like hello.php.

Keep it visible to yourself

Hiding the plugin from every account, including your own, gets confusing fast. This version keeps the full list for one username:

add_filter( 'all_plugins', function ( $plugins ) {
	// Your own account still sees the full list.
	if ( 'yourusername' === wp_get_current_user()->user_login ) {
		return $plugins;
	}
	unset( $plugins['akismet/akismet.php'] );
	return $plugins;
} );Code language: PHP (php)

Replace yourusername with your login name.

What it does not hide

When the hidden plugin has an update, it still appears under Dashboard > Updates and in the update count next to Plugins in the admin menu. Leave that alone: hiding the updates as well means nobody updates the plugin. It is also hidden only from this one screen. WP-CLI’s wp plugin list, FTP and the file manager in your hosting panel still show it.

If it must never be deactivated

Hiding a plugin does not stop anyone from turning it off. If the code must always run, make it a must-use plugin instead: put the file in wp-content/mu-plugins/. Must-use plugins load automatically, cannot be deactivated from the dashboard and are listed only under a separate Must-Use tab. WordPress loads only PHP files sitting directly in that folder, so a plugin with its own folder needs a one-line loader file there that requires its main file.

Where to add this code

Add the snippet with a code snippets plugin instead of your theme’s functions.php, so it survives theme updates and you can switch it off without FTP. This guide shows how with the free Code Snippets plugin. On my own sites I use WPCodeBox, which keeps snippets in a cloud library so the same snippet can go on several sites. (Marius)

Disclosure: the WPCodeBox link is an affiliate link. If you buy through it, I earn a commission at no extra cost to you.

48 thoughts on “How to Hide a Plugin From the WordPress Plugins List”

  1. What happens when they update their theme and the functions,php is over-written? Wouldn’t it be better to make it an automatic ‘include’ somewhere?

    1. FuckedlnTheHead (@FuckedlnTheHead)

      Terence,

      Create a directory called wp-content/mu-plugins

      Inside this directory create any php file and drop the function in there. This file will always be loaded by WordPress as it is in the “Must Use Plugins” directory.

      You’re welcome.

  2. 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?

    1. It pretty much depends on the site. If I have pretty much access to everything then I’d add it in a custom plugin. It makes sense to add it to /mu-plugins/ folder.

  3. 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. Replace the 4th line with the following code and tell me if it’s working:

      $hidearr = array(WP_PLUGIN_DIR.'plugin-directory/plugin-file.php');

    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 :)

  4. The file isn’t in any other directory. There is only one location for the file. So I think what we have discovered is that this method doesn’t work with multisite.

  5. Thanks Hardeep. It works very well with single-site either as a plugin or in functions.php. Its just the method of making it persistent beyond a theme update that’s bugging me.

  6. 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. Make sure to activate the plugin that you put this code into it. I use this code into my daily stuff and it always works :)

        1. The code which is in the article. I have updated the article with a new snippet to hide it from the Network admin as well.

  7. Hi!

    Great – Just what I was looking for.
    I often help clients that also are admins?

    How can I hide plugins and updates for all users also admin – except me?

    Lets say I am user “Netz” or ID 77 ??

  8. Let me just be clear… When I say “HIDE”… I mean not in the Menu, not in the plugin list – Not anywhere!?
    Only me meself and I can see the plugin and possible updates :-)

        1. Your client will be the admin. You’ll get the developer role and he won’t be able to see this developer plugin.

          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.

            1. 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.

    1. 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. Try to create an array like this:


        $hidearr = array();
        $hidearr[] = array('plugin-directory/plugin-file.php');
        $hidearr[] = array('plugin-directory/plugin-file.php');

        1. Thanks a million Hardeep Asrani
          I got the combi of the plugin and your trick to work for me… :)
          Have a great day!

          Peter

      2. 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,

                1. 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');

        1. 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!

        2. 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

          1. Unfortunately, it’s not possible to remove it from the source code. But at the same time, no one checks the source code in admin page to see which plugins that site is using. :)

        3. 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.

        4. This is an older post, but it shows in search results. My question is how to list any plugins that are hidden – those that don’t show up in the Admin, Plugins list for an Administrator (or SuperAdministrator) role.

          SInce plugins can be hidden, a ‘nefarious actor’ could use a hidden plugin on a site to perform their ‘evil’ tasks. How would you show such a hidden plugin for further investigation?

        5. Although this code works, it does not remove the ‘settings’ screen for the plugin. And remember that a plugins Settings screen can be anywhere.

        Leave a Reply

        Your email address will not be published. Required fields are marked *