How to fix the “Cannot Deactivate WordPress Plugin” Error

It’s common knowledge that plugins are a very important aspect in the success of every site since they are what enriches a site with all the functionalities it needs to serve its user base in the best way possible.

Besides that, plugins are something unique in the software world since nothing in it is able to be as practical and powerful as plugins are.

For that reason, it’s very unfortunate and inconvenient when plugins and the platforms designed to support them come in any type of conflict.

You got the “Cannot Deactivate WordPress Plugin” #error and have no idea how to fix it? Then check out this article that will introduce you to not 1, not 2 but 4 methods of resolving it! Click To Tweet

One of the most common conflicts between WordPress and plugins arises when you try to delete a plugin. Very often in that situation, a WordPress user will receive the infamous  “Cannot Deactivate WordPress Plugin” error.

This error can occur both in the case when you are deleting a plugin from the WordPress dashboard or through an FTP client.

What is the reason for this error occurring and how to successfully free your site from it is exactly what we will be talking about in this article.

So, if you are interested be sure to keep reading!

Why are you having trouble removing a plugin?

Stressed man using laptop

We all know that the internet is loaded with plugins ranging from those in the WordPress repository to those on the sites of independent plugin sellers/distributors.

Very often in that huge array of plugins a “bad apple” gets mixed in, a poorly or even maliciously coded plugin.

Plugins like these more often than not come with hidden and nested files which are sometimes almost impossible to delete through standard methods.

But why is that? Well, these nested or hidden plugin files are buried deep in directories, which to make things worse, are hidden as well. And without an external file manager (which a lot of people forget about) those directories and the files within them can’t be found.

Files of this sort are the exact reason why you may be facing so much trouble when attempting to do something as simple as deleting a plugin.

Why is this such an issue?

To some of you what we are about to say now might seem completely obvious since you are aware of the consequences of having bad plugins on your site.

But to some people the “Cannot Deactivate WordPress Plugin” error might be just another inconvenience they ignore.

Doing this is basically the worst approach you can take since bad/malicious plugins can “lock you out” of your WP-Admin dashboard or in other words, can stop you from accessing your site entirely.

Error graphic art

If this happens, you will need to go into your website’s error log to find out what pesky plugin caused the issue. Meaning that you will have another step in the process necessary to complete.

That is why as soon as you spot a faulty/buggy plugin, get it out. Immediately!

Now you might say that it’s easy for us to boss you around without providing any explanation as to how this issue can be resolved. And that would be an absolutely justified statement if we didn’t prepare that explanation in the section below.

Methods of resolving the error

Before using any of the methods we are about to mention, it might be a good idea to create an under maintenance page for your site just in case you mess anything up. The under maintenance page will keep the entire process under wraps, and your site visitors will know you will be back soon.

The easiest way you can go about creating the page is by using the Coming Soon & Maintenance Mode plugin.

Coming Soon & Maintenance Mode

This plugin will provide you with a drag-and-drop builder using which you will be able to create the page within a few minutes. Along with that, you will also have access to 170+ themes, best-in-class SEO setup, autoresponder and emailing services, a rebranding feature and so much more.

And as if that wasn’t enough, the plugin is also integrated with Depositphotos, meaning you will be able to find the appropriate visuals directly from the plugin!

Through the database

To delete a plugin from the database you’ll need the help of a pretty known tool called phpMyAdmin. This tool will enable you to access your database and find the files of all of the plugins that are installed on your site.

The first step you will need to make in this process is to log into phpMyAdmin. After doing that, your next task is to find a table called “wp-options”.

phpMyAdmin dashboard

Within that table should be a row labeled “active-plugins”.

That row will have a delete option, this option will delete all of your plugins. If that is something you want to do then feel free to click it.

If on the other hand, you want to delete just one plugin, then you should click on the edit option instead.

The edit option will take you to a screen with some pretty weird text (as seen in the image below) but that text will also have the names of your plugins included in it.

Active Plugins database record

 

To delete a plugin listed there, all you need to do is change the text from what it currently is, to “a:0”, and click go once you are done.

Active Plugins disabled

And just like that, you will delete a plugin or multiple plugins with the help of your database.

Using an FTP file manager

The second method of resolving the error is to uninstall the plugin using a file manager.

cPanel dashboard

For this method, you have the liberty to choose between an FTP client or cPanel, whichever you prefer. All that matters is that it will allow you to access the plugin directories.

For demonstration purposes, we will assume you are going to use the FileZilla FTP program.

The steps for uninstalling a plugin using FileZilla are as follows:

  • Download and install FileZilla
  • Run FileZilla and connect to your website server (keep in mind that you will need credentials to be granted access)
  • After you have successfully logged in, you should have complete access over your website files which are located on the server
  • Next what you need to do is find a directory named “/public_html/wp-content/plugin_name” (the “plugin_name” part will be the actual name of the plugin) and delete that entire directory

With all these steps completed, your website should be free of the “Cannot Deactivate WordPress Plugin” error.

If the written explanation wasn’t enough, maybe the video below might help you understand the process more clearly.

Using Secure Shell (SSH)

When all methods fail, the command-line interface is there to help you out.

The command-line interface can with the help of programs such as PuTTY, get access to your site’s internal files through the use of the SSH protocol.

Putty terminal window

You can use this method to get rid of buggy plugins by:

  • Downloading and installing an SSH client such as PuTTY or Bitvise SSH Client
  • Running the program
  • Entering your server’s IP address in the hostname input filed
  • Navigating to “../wp-content/plugins/” with the help of SSH commands
  • Deleting the desired plugin folder with the “rm (Plugin Name)” command
  • Logging out and checking if the removal was successful

Using the WP Reset plugin

WP Reset plugin

If you haven’t heard about it by now, we have to warn you that the WP Reset plugin is something that will seriously impress you.

This plugin is able to reset an entire site or just specific aspects of it to a clean slate or a previous version.

Using this plugin you can easily get rid of the “Cannot Deactivate WordPress Plugin” error by simply resetting your site’s plugins section. That whole process is initiated with just one click and will take only a few seconds.

Delete plugins option

Now you might be thinking “But what if I can’t access my site in order to use this plugin?”. The plugin creators took this into consideration as well.

With the plugin comes something called the Emergency Recovery Script which can revive your site form the white screen of death and which will allow you to delete plugins (in bulk or one by one) even if you can’t access the WP Admin dashboard.

Delete plugins option in ERS
So if some plugin was the reason you weren’t able to log into your site, that issue can be resolved in minutes with the help of this script.

Best of all, WP Reset will enable you to create snapshots of your database allowing you to revert back to a previous version of your site, and will give you the option to create collections of plugins (and themes) which you can install in bulk post reset or at any time that you want.

This plugin has plenty of other features as well, but that is a topic for another time. If you are curious to find out more about that right away, go check out the official WP Reset website.

Or you can watch this very informative video instead:

Conclusion

And there you have it! Four very easy methods of removing stubborn and buggy plugins.

Now that you know how to solve the “Cannot Deactivate WordPress Plugin” error, it’s about time you stop ignoring it or postponing resolving it.

Doing that will only cause harm and regret on your part for not taking action sooner.

Hopefully, the four methods we presented you with, in this article, will help you get your site running smoothly again.

But if in the meantime you find or develop a method of your own, please don’t hesitate to share it with us in the comments below!

Leave a Comment