Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Hide Plugin From Plugins List

Posted on 2014-10-22
14
Medium Priority
?
156 Views
Last Modified: 2014-10-24
Hi,

Is it possible to hide plugins from the plugins list. I have a 2 plugins that i always set up on each of my client's websites.

A few of my clients have started playing around with the settings that the plugins provide and therefore they have messed up their website, so i'd like to start hiding these from now on.
0
Comment
Question by:oo7ml
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 3
14 Comments
 
LVL 32

Expert Comment

by:DrDamnit
ID: 40397154
I don't think there's a way that you can hide a plug-in. But there is probably is a way that you can modify the plug in to give them a warning that any changes that they make if they break their website that they will have to pay you to get them fixed. Fair warning makes sending an invoice very easy.
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 40397158
Or even better: you could just backup the database and when they break their website just will restore. They might lose some data, but that's what they get if they can't follow directions.
0
 

Author Comment

by:oo7ml
ID: 40397187
Yeah, but when clients see the settings available the want to understand what each option does etc... a much simpler method would be to hide the plugin
0
Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

 
LVL 32

Expert Comment

by:DrDamnit
ID: 40397251
What you want is compliant behavior from the client. Charge for training instead of trying to hack the WP core. I am fairly sure that what you're asking isn't available without hacking the core, and that's just not a good idea because it could introduce vulnerabilities or instability.
0
 
LVL 32

Assisted Solution

by:DrDamnit
DrDamnit earned 700 total points
ID: 40397272
I just found this:

http://stackoverflow.com/questions/3707134/easiest-way-to-hide-some-wordpress-plugins-from-users

and, ideally, this would ("could") work; however, I cannot find any documentations for the all_plugins filter, which may have been removed in the current version of WP.
0
 

Author Comment

by:oo7ml
ID: 40397284
Ok cool, thanks... i'll look into this... i thought there might be a few lines of code that could be added to the plugin itself to hide it.
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 40397356
If I have some time later today, I can grep the code and see if that filter still exists...
0
 
LVL 38

Accepted Solution

by:
Tom Beck earned 1300 total points
ID: 40397531
Might be easier to put the plugins you want to hide in a Must_Use_Plugins directory (http://codex.wordpress.org/Must_Use_Plugins). This removes them from the normal list of plugins. Then hide the must-use tab on the plugins page.

Maybe something like this (untested):
add_filter( 'show_advanced_plugins', 'hide_plugin_list', 10, 2 );
    function hide_plugin_list($show, $type)
    {
        if($type == 'mustuse') 
        return false; 
    }

Open in new window

0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 40397548
I like Tom's post better.
0
 

Author Comment

by:oo7ml
ID: 40398140
Thanks Tom and Michael.

Could you elaborate on the Must_Use_Plugins approach please?
0
 
LVL 38

Expert Comment

by:Tom Beck
ID: 40398460
Create a folder inside the wp-content folder called mu-plugins. Move the directories for the plugins that you want to hide from the plugins folder over to the mu-plugins folder. Now when you log in to the Dashboard and go to Plugins, you will see a new link at the top for Must-Use. On that page will be the plugins you moved into the mu-plugins folder.

Next, go to the functions.php file inside your theme folder and add the code I suggested to hide the link to the Must-Use section. The code works, I just tested it. If you ever need to manage those plugins in the future you will have to comment out this line in the functions.php file so the Must-Use link comes back.

add_filter( 'show_advanced_plugins', 'hide_plugin_list', 10, 2 );
0
 

Author Comment

by:oo7ml
ID: 40398735
Thanks Tom, much appreciated.

Do i need to create / set all of this up before i install the plugins.

I presume if i move the plugins now it will cause problems as they are installed from a different directory. Thanks again for your help on this, it's much appreciated.
0
 
LVL 38

Expert Comment

by:Tom Beck
ID: 40399045
WP never gives you a choice as to what folder to install a plugin. Supporting files for a plugin installation always go in the Plugins folder. But WP knows to also look in the mu-plugins folder for supporting files if that folder exists. Just physically moving the supporting files from the plugins folder to the mu-plugins folder should be all you need to do. At the link I provided you will see that physically moving the plugin files is the only way to make a must-use plugin. It's by design, originally created to allow administrators to physically add plugins to multiple sites without logging in to each dashboard. "mu" originally meant "multi-user". Possibly, if a plugin requires another folder outside of itself to function, like an uploads folder for example, moving the files may break the plugin depending on how it was written. But I never experienced this. Anyway, experimenting will not permanently hurt anything. You can always just restore the original location.
Also understand that this method only hides the plugin from the list. If the plugin you are hiding creates menu items on the left side of the Dashboard as part of the installation, and these menu items allow a user to change settings, they are still going to have those menu items unless you remove them using additional code hacks.
0
 

Author Comment

by:oo7ml
ID: 40401206
Thanks Tom,

One of the plugins i use is used to hide some of the tabs in the left menu :-) yet some of my clients access the settings for this plugin on the plugins page and start messing up things. Thanks for all your help.
0

Featured Post

Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question