wordpress-pluginsAs a WordPress Developer, Sometimes you dont want the user to deactivate certain plugins which are very essential for the site and the deactivation can also break up the entire site.

In such cases you can either explain the importance of those plugins to your client or to hide  “Installed Plugins settings” from the dashboard so that user won’t be able to deactivate it.

Here is a WordPress code snippet which will hide the plugin from “Installed Plugins settings” once the plugin is activated.For example,once the WordPress SEO by Yoast Plugin is installed and activated user cannot able to see the Plugin from Installed Plugins settings (Dashboard >> Plugins >> Installed Plugins) thus user canot deactivate the plugin.

You need to add the following code in functions.php file of your active WordPress Theme.

add_filter( 'all_plugins', 'hide_plugins');
function hide_plugins($plugins)
	// Hide hello dolly plugin
	if(is_plugin_active('hello.php')) {
		unset( $plugins['hello.php'] );
	// Hide disqus plugin
	if(is_plugin_active('disqus-comment-system/disqus.php')) {
		unset( $plugins['disqus-comment-system/disqus.php'] );
	return $plugins;

The above code will hide Hello Dolly plugin and Disqus comment system.Similarly you can deactivate WordPress SEO by Yoast and Akismet by adding following code.

add_filter( 'all_plugins', 'hide_plugins');
function hide_plugins($plugins)
		// Hide WordPress SEO by Yoast Plugin
		if(is_plugin_active('wordpress-seo/wp-seo.php')) {
				unset( $plugins['wordpress-seo/wp-seo.php'] );
		// Hide Akismet Plugin
		if(is_plugin_active('akismet/akismet.php')) {
				unset( $plugins['akismet/akismet.php'] );
		return $plugins;

I have tested the code in my local WordPress setup and it works really out of box.Pretty cool,Try it out atleast once.

The only drawback is if user removes the coded from functions.php then it will be visible again.

Thanks to  for this excellent code snippet.


  1. says

    Please let me know if you’re looking for a article author for your site.
    You have some really great articles and I believe I would be
    a good asset. If you ever want to take some of the
    load off, I’d absolutely love to write some articles for your blog in exchange for a link back to mine.
    Please send me an e-mail if interested. Thank you!
    www recently posted…wwwMy Profile

  2. says

    But I could not understood how blog user will deactivate blog plugin . Because they don’t have access to do that . If reader is register as Author they may only write new blog post

    • says

      If you implement this then only the super admin (created while installing WordPress) can deactivate the plugins. For example let say I install WordPress behalf of my client who is noob and then I can implement this trick to avoid deactivation of any plugin. Here note the I have given Admin account to my client but yet client can’t see the plugin in dashboard.
      Vivek R recently posted…Genesis 2.0 Review : A Killer Update of Genesis FrameworkMy Profile

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge