An error on a WordPress website can sometimes be caused by activating a certain plugin. We can deactivate plugins on a WordPress site by using a File Transfer Protocol like FileZilla to rename the “plugins” folder. Since WordPress looks for the “plugins” folder to list and activate plugins, renaming this folder causes plugins to deactivate.
This method helped me to resolve a WordPress site error that was crashing parts of the Dashboard and making the Plugin Editor inaccessible. So if you’re experiencing a critical error this method of deactivating and reactivating all plugins could help.
Deactivating Plugins by Renaming “plugins” Folder
To rename our “plugins” folder, we connect to our WordPress server using FTP, then navigate to the “wp-content” folder of our site, along a path that looks like:
“public_html > my_site_folder > wp-content > plugins”
We can rename the plugins folder to anything we like, for example “plugins.hold”. See screenshot below from FileZilla FTP:
We have to switch back to our WordPress dashboard and refresh the page for the folder name change to take effect and deactivate the plugins. When we switch back to our WordPress dashboard, we should see our plugins listed but a message telling us that the plugin files don’t exist (see image below):
Now if we want to reactivate our plugins, we can rename our “plugins.hold” folder back to “plugins”. Returning to the dashboard and refreshing, we should see all plugins now listed properly, but deactivated:
To reactivate the plugins, we can simply reactivate them one-by-one, or all at once. If there is a suspected malicious plugin and we don’t know which one it is, I like to use a kind of “binary search” method, where I reactivate half of the plugins, see if the site breaks, then activate half of the remaining plugins, etc.
If for some reason we don’t want to add back all of the plugin files to the “plugins” folder, we can simply create a new folder called “plugins” (while our plugins are still living in “plugins.hold”) and then we can move the plugins we want to reactivate into the “plugins” folder.
That’s all! Good luck with your debugging! 🐛