No, this is not a post that shows how you can hack a site and disable any plugin you want without access, you still need some kind of access to the site. But if you're running a site and something happened that caused you to be blocked out of your admin area – e.g. a plugin is giving a white page everywhere you'd need to disable that plugin without access to the /wp-admin area.

Luckily there are some easy ways to quickly disable a WordPress plugin without needing direct access to the admin. My favourite way is to change the plugin folder name, which will prevent WordPress from being able to load the (corrupt) plugin files. 

Try First

Since we're discussing a scenario where a plugin is blocking you out, try to login to your site through the mydomain.com/wp-login.php URL first. It surely doesn't guarantee anything, but depending on whats going on it may just work to login and disable the plugin through the admin anyways. 

Disable a Plugin Through FTP

The easiest way to disable a plugin is through FTP. If you're not sure what your FTP credentials are, you can likely find / configure / request them through your hosts' configuration panel. This may be cPanel, DirectAdmin or their own customer panel.

When you're connected to your site through FTP you can navigate to the wp-content/plugins/folder. In there you'll see all your installed plugins listed. If you know which plugin is causing the error you can rename that plugin folder, for example add a d- prefix / postfix to indicate its disabled.

Try and load your site again and see if you everything is back to a working order. If its not it could be there's another error, or the disabled plugin was not what caused it in the first place. You can try and disable other plugins that you may suspect.

Disabling All Plugins at Once

You can also disable all plugins at once by renaming the plugins directory. This will likely leave your site in a bare-bones state, so be thoughtful when doing this.
When heading back to your site big chance it started working again. If its not, it could be that either your theme is causing the error in the first place, or possibly because a plugin your theme requires is now unavailable.

After Disabling a Plugin

Once you've renamed a single plugin folder or the entire plugins directory WordPress won't be able to find the files and won't load them. Only when you head over to the Plugins page it will actually deactivate the plugins completely.

This is important to know, as it will give you the ability to easily test out plugins. If you've disabled multiple plugins you can start re-enabling them one by one if you're not sure which one was the actual cause.
If you haven't been on the Plugins page yet it won't really have been deactivated and WordPress will still load the files when they're back available.

Say you've disabled all the plugins at once as described above. You can create a new plugins folder and start dragging plugins bit by bit from the plugins-d(or whatever you've renamed it to) folder and you won't have to activate the plugins one by one manually.

Disabling Plugins Through the Database

This is a bit trickier method, but may be your last resort if you don't have access to the FTP. Connect to your database using your favourite program, for many this is phpMyAdmin, Adminer or Sequel Pro.

Go into the _options table and search for the row with the active_plugins option name. If you can't find it or don't know how to search, here's a SQL query that you can use to search;

SELECT * FROM wp_options WHERE option_name = 'active_plugins'

With the row in the database you can either rename the option_name field value or empty out the option_value value. Both ways will disable all plugins on your site. It is highly recommended to keep the contents of the value field somewhere as a backup to be able to restore all the previously activated plugins.

Deactivating plugins one by one through the database is possible, but quite a bit harder. If wanted you can read more about that on the next page.

About the author: Jeroen Sormani is actively building WordPress, WooCommerce and Easy Digital Downloads plugins. Slightly obsessed by writing high quality code.
Follow Jeroen on Twitter

Leave a Reply

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