20 Jul 2016

Disable all plugins using mySQL

Sometimes when trying to log into the wordpress back end I get the dreaded whitescreen of death. This is usually caused by a plugin. The solution is usually realtively painless: disable all the plugins. This fixes the admin login whitescreen issue. Plugins can then be enabled individually, checking to see which plugin breaks the login page.

I suggest making a backup of the site before proceeding. Then, log into your database using phoMyAdmin (or whatever you use to access the database), and run the following SQL query (Edit the table prefix wp_ to match the prefix used in your database):

SELECT * FROM wp_options WHERE option_name = 'active_plugins';

Once the active_plugins column appears, click to edit it. You will see something similar to the following, depending on the number and type of plugins you have installed:


That entire array of code represents every active plugin on your site. To quickly disable all plugins without using the WP Admin area, highlight the entire block of code, cut it out, and paste it into an offline text file to keep it safe (and so you can refer back to it if needed). After removing the code, click the button to save your changes. All WordPress plugins are now deactivated (yet still installed, and with all plugin options intact). Once you are ready to re-activate your entire set of plugins, simply cut/copy & paste the preserved code back into the active_plugins field. Click save and you are done.