Hide Subsite Plugins

Is there a plugin to hide the plugin from the subsites? I want to hide some of the plugins but not all of them. I just the users to see the plugins necessary for them to use the site. But for example, they don't need to see the snapshot plugin or any other plugins that super admins network activate. I did a search on the plugin selection and I tried a plugin called "hide plugins" but it did not work. I installed the ultimate branding plugin form WPMU but this plugin does not hide the plugins from the subsites. Please let me know if there is a plugin available to hide the plugins!!

  • Dimitris
    • Support Star

    Hey there Janet Chavez,

    hope you're doing good and thanks for reaching us! :slight_smile:

    I don't know any plugin that simply hides plugins from sub site's listings, but this could be done via a simple MU plugin (simply create a file like /wp-content/mu-plugins/hide-plugins.php in your server, create the mu-plugins folder if it doesn't exist).

    function hide_plugins() {
    	global $wp_list_table;
    	$hidearr = array('wp-defender/wp-defender.php');
    	$myplugins = $wp_list_table->items;
    	foreach ($myplugins as $key => $val) {
    	 	if (in_array($key,$hidearr)) {
    function trigger_hide_plugins() {
    	$blog_id = get_current_blog_id();
    	if ( $blog_id != 1 ) {
    		add_action('pre_current_active_plugins', 'hide_plugins');
    add_action('init', 'trigger_hide_plugins');

    Reference: https://trickspanda.com/hide-wordpress-plugin-plugin-list/

    You should change/check:
    1. $hidearr should contain the appropriate array of plugins that you want to hide. You should declare the folder name and .php file that "constructs" the plugin. In my example I chose to hide our WP Defender plugin.
    2. $blog_id != 1 double check that main blog has indeed an ID=1 or else change this value. You can find this if you navigate to Network admin area under Sites and edit the main site. The URL in the site edit screen should be something like /wp-admin/network/site-info.php?id=1 :wink:

    Hope that was some help, feel free to post back here if more assistance is required!
    Warm regards,

  • Adam Czajczyk
    • Support Gorilla

    Hello Janet!

    The Pretty Plugins plugin doesn't let you hide plugins. It allows you to "brand" them: change their names and descriptions, set custom images to be used on plugin list etc. After Pretty Plugins plugin is installed and network-enabled this can be done by going to the "Network admin -> Plugins -> Installed plugins" page and clicking on "Edit Details" link below each plugin.

    What Dimitris suggested seems to be the simplest way to hide plugins. It's really much easier than it seems to be :slight_smile: However, if you don't feel like you could handle that yourself I think we can help you. What I would need however would be:

    - a list of plugins that you wish to hide
    - a full access to your site

    If you wish me to assist you with that, let me know about the plugins to be hidden and also send in:

    Subject: "Attn: Adam Czajczyk"

    - Mark to my attention, the subject line should contain only: ATTN: Adam Czajczyk
    - Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.
    - Link back to this thread
    - login URL and admin account login credentials (may be a temporary admin account) data
    - Include FTP log-in details (hostname, username & password)
    - Include hosting control panel access details (login address, username & password) - cPanel's usually the control panel used for this, but your provider may use something else; I'll need this in case you weren't able to provide FTP login information;
    - Include any relevant URLs for your site

    Please use our contact form here http://premium.wpmudev.org/contact/

    Select "I have a different question" from the drop-down list. 

    Please be sure to make a full backup of your entire site first!

    Kind regards,

  • Janet Chavez
    • Flash Drive

    I read it is not a good idea to have a must use plugin. I looked at your reference above but that was talking about adding the code in the theme's functions.php file not to create a MU plugin.
    Thanks, Adam but I don't feel comfortable giving out ftp or cpanel access.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.