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:

a:15:{i:0;s:35:"redux-framework/redux-framework.php";i:1;s:35:"akeebabackupwp-1/akeebabackupwp.php";i:2;s:36:"contact-form-7/wp-contact-form-7.php";i:3;s:57:"double-opt-in-for-download/double-opt-in-for-download.php";i:4;s:59:"intuitive-custom-post-order/intuitive-custom-post-order.php";i:5;s:27:"js_composer/js_composer.php";i:6;s:49:"ninja-forms-mail-chimp/ninja-forms-mail-chimp.php";i:7;s:53:"ninja-forms-recaptcha-field/ninja-forms-recaptcha.php";i:8;s:27:"ninja-forms/ninja-forms.php";i:9;s:23:"revslider/revslider.php";i:10;s:43:"simple-social-icons/simple-social-icons.php";i:11;s:43:"village-client-area/village-client-area.php";i:12;s:59:"village-portfolio-post-type/village-portfolio-post-type.php";i:13;s:24:"wordpress-seo/wp-seo.php";i:14;s:23:"wp-smushit/wp-smush.php";}

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.