Latest Tweets404 Fix: Block Nuisance Requests for Non-Existent Files:…
Perishable Press

Quickly Disable or Enable All WordPress Plugins via the Database

[ The Flash ] Recently, while dealing with the dreaded white screen of death, I found myself unable to login to the WordPress Admin area to manually disable all of the plugins used here at Perishable Press. In the past, I have dealt with this situation by simply deleting all plugin files from the server, however this time, time was of the essence — I had only a few minutes with which to troubleshoot, diagnose, and ultimately resolve the deadly white-screen syndrome. Fortunately, after a few minutes of digging through the WordPress Codex, I had discovered enough information to successfully complete my mission. Now that the fiasco is over, I want to share a simple technique for quickly disabling and (re-)enabling your entire set of WordPress plugins.

In the blink of an eye..

Before beginning, make a backup copy of your database. Then, login to your database using phpMyAdmin (or whatever), and navigate to the “active_plugins” column of the “wp_options” table using the following SQL query (edit the default WordPress table prefix “wp_” if needed):

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. Thus, to quickly disable all plugins without using the WP Admin area, highlight the entire block of code, cut it out, and paste it into a safe, offline text file. After removing the code, click the button to save your changes and that’s it. All WordPress plugins are now deactivated (yet still installed, and with all plugin options intact). This obviously is a huge time-saver that really comes in handy during those mission-critical, time-sensitive situations where every second counts. 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 done. Again, don’t forget to backup your database before editing it ;)

Nuke ’em!

Alternately, here is a one-second query to disable all plugins:

UPDATE wp_options SET option_value = '' WHERE option_name = 'active_plugins';

Upon execution, this query will clear the active_plugins field of all active plugins (duh), effectively disabling (without uninstalling or modifying) the entire set. This method is great if you plan on re-enabling each plugin individually, say, after resolving some heinous server error. Whereas the previous technique makes it easy to re-enable all plugins en masse, this query is perfect for simply “nuking” all active plugins with no remorse. ;)

Updated Method

Apparently, this method works only for WordPress versions less than 2.9. For 2.9 and better, use this instead:

UPDATE wp_options SET option_value = 'a:0:{}' WHERE option_name = 'active_plugins';

So use that if working with WP 2.9 or beyond!

Jeff Starr
About the Author Jeff Starr = Web Developer. Book Author. Secretly Important.
16 responses
  1. David Radovanovic December 13, 2008 @ 8:15 am

    Thanks for another VERY useful (and FAST) tutorial for an avid fan who seems to get into many a fix only to find himself back at Perishable Press!

  2. Thanks for posting this, I knew that there was probably a quick way in phpmyadmin to turn them off, but didn’t know what to look for. Good to know about renaming the plugins folder too Ozh!

  3. Thanks, just ran into a problem when I upgraded to wordpress 2.7 and your info helped me out.

  4. Jeff Starr

    My pleasure, Paul! Glad to be of service! :)

[ Comments are closed for this post ]