InterSET

How To Hide Specific WordPress Plugin From Plugin List

Share Now:

Share on facebook
Share on linkedin
Share on twitter
Share on email

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

function hide_plugin_interset_cloud() {
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_interset_cloud’);

 

For example:

function hide_plugin_interset_cloud() {
global $wp_list_table;
$hidearr = array(‘elementor/elementor.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_interset_cloud’);

Get Free Access to InterSet’s 1 GB SSD Hosting with Website Design


Know Your Entity Destiny Offers Savings

More You Would be interested in . . .

Have you any Question ?
Ask us !