How to Ensure that Users Do Not Deactivate The Critical WordPress Plugins

It’s no secret that among all the remarkably useful features of WordPress, its plugins occupy the top spot. The WordPress plugins are the tools that help the webmasters, irrespective of their technical acumen, to take their website beyond the defaults and add settings that can hand them over with complete control over their website.

Having said that, the plugins can also go a long way in increasing unnecessary load on a website and burdening the server to a point that the website’s speed is hampered to a large extent. There are several plugins that hardly serve the purpose they are installed for and instead upload far too many files on the server, rendering it slow.

Realizing this, many webmasters have started paying attention to the plugins they need and the plugins they don’t need. This way, they get a clear eyed picture as to which plugins should they uninstall from their website so that the load is minimized.

And this is also recommended by experts since some people are in the habit of installing random plugins that instead of providing their website with useful features go on to inject some malicious code in the site. So, the practice of not installing everything you come across and installing plugins that you don’t need in present or in near future serves webmasters well enough

That said, however, there is a huge possibility that a website owner, with not much technical knowledge, might end up uninstalling a crucial plugin that happens to be the core part of the website. Uninstalling or simply deactivating such a plugin may make the website unstable and eventually, the website owner may have to hire an expert to get the issue fixed.

Now, this is a scenario that WordPress developers are not really fond of. When they are creating a particular theme, they don’t want it to be on the mercy of the end users. In such a scenario, hiding the respective plugins from the list of installed plugins becomes all the more important. Apparently, if the user can’t see the plugin, he or she can’t deactivate or uninstall it.

How You Can Hide a Particular Plugin

innerwordpress

For what it’s worth, hiding a particular plugin from the list of installed plugins is also a breezy job. There is a small WordPress code snippet that will hide any plugin you want once that particular plugin is activated. Let’s say, you want to hide the W3 Total Cache plugin from the list so that this speed booster plugin permanently resides in the website and fights the speed-affecting factors uninterruptedly. Along with that, you mignt The code for hiding it has to be added to the functions.php file in your theme:

add_filter( 'all_plugins', 'hide_plugins');
function hide_plugins($plugins)
{
	// Hide Starbox plugin
	if(is_plugin_active('starbox.php')) {
		unset( $plugins['starbox.php'] );
	}
	// Hide W 3 Total Cache plugin
	if(is_plugin_active('W3Total Cache-Speed-optimizer/W3TotalCache.php')) {
		unset( $plugins['W3Total Cache-Speed-optimizer/W3TotalCache.php'] );
	}
	return $plugins;
}

This code will most certainly hide away the the plugins Starbox and the W3 Total Cache from the list so that they can’t even be accidentally deactivated or uninstalled.

Similarly, other plugins can also be uninstalled with a simple enough code.

add_filter( 'all_plugins', 'hide_plugins');
function hide_plugins($plugins)
{
		// Hide Share This Plugin
		if(is_plugin_active('wordpress-seo/sharethis.php')) {
				unset( $plugins['sharethis/sharethis.php'] );
		}
		// Hide Akismet Plugin
		if(is_plugin_active('akismet/akismet.php')) {
				unset( $plugins['akismet/akismet.php'] );
		}
		return $plugins;
}

More and more number of WordPress developers are using this code to safeguard the critically important plugins that command a permanent place in websites. If you are one of the WordPress developers wanting to find a way that hides your plugin from the installed plugins list, do try this out.

Author Bio :
Ben Wilson is working as a certified WordPress plugin developer at WordPrax Ltd – a leading WordPress CMS Development Services and Solutions Company. He loves sharing useful insights on WordPress plugins and their varied uses.

Recently Published

»

Is Your Business Site Fully Accessible?

Does your business site have full accessibility? Even with the ADA ...

»

Secure Web: 5 Best Practices For Application Development

There are several essential best practices for secure web ...

»

Laravel PHP Framework: Features and benefits for web development

Companies and organizations are focusing on developing custom web ...

»

Web Development Vs. Software Development: What Is the Difference?

As technology continues to transform all aspects of our lives, a lot ...

»

Web Redesign : Is Your Landing Page Begging for one?

How do you know when it’s time to web redesign your landing page? ...

»

Customer Acquisition: Few Steps To Improve This.

Customer acquisition is essential to any business’s success — to ...

»

Mobile App Development Tools: 5 Enterprise-Ready For Rapid Deployment

There are several enterprise-ready mobile app development tools for ...

»

Docker: How To Build Better Development Security With It

The top concern among developers and DevOps teams is security within ...

»

Mobile Development: How to Reduce Costs

Modern markets have become so competitive that it has become vital ...