Plugin Sale! Save 15% on pro plugins with discount code: FALL2020
Web Dev + WordPress + Security

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 = Fullstack Developer. Book Author. Teacher. Human Being.
Banhammer: Protect your WordPress site against threats.

16 responses to “Quickly Disable or Enable All WordPress Plugins via the Database”

  1. Or: just rename the wp-content/plugins/ folder.
    You will have to manually reactivate the plugins after you rename the plugins folder back to its original name, but all plugin options are preserved too.

  2. Jeff Starr

    Ahh yes, good call there, Ozh! Simply renaming the plugins folder is another efficient, effective technique for quickly disabling all plugins.. Why am I not surprised that I haven’t thought of this myself? Thanks for the tip! ;)

  3. Thank you, that’s exactly what I was looking for.

  4. Jeff Starr
    Perishable 2008/04/06 8:51 am

    My pleasure! Thanks for the feedback!

  5. pilotmike 2008/07/17 6:24 pm

    Thank you very much for this post. You saved me from a bad maintenance mode plug-in during the upgrade from 2.5.1 to 2.6.

    There is a reason why they tell you to disable ALL plug-ins. :)

    Thanks a ton for taking the time to put this up!

  6. Jeff Starr
    Perishable 2008/07/20 7:10 am

    Happy to help, pilotmike — thanks for the comment!

  7. Thanks — that was a big help!

  8. Jeff Starr
    Jeff Starr 2008/08/05 7:30 am

    My pleasure, Kyle — glad to be of service! :)

  9. Hi, i’m new on WordPress. I’m googling about how to add ‘notify me off follow-up comments via email’ and land on this page :). I’m glad to know this blog, i’ve got something new to learn. Thanks.

  10. Jeff Starr

    Glad to be of service, Phoenix! Thanks for the feedback :)

  11. Thanks. You’ve helped me bring my site back up after my provider moved servers on me and decided not to assist. Avoid Dreamhost.

  12. Jeff Starr
    Jeff Starr 2008/11/16 8:53 pm

    Happy to help, Jonathan — thanks for the heads up on Dreamhost! ;)

Comments are closed for this post. Something to add? Let me know.
Perishable Press is operated by Jeff Starr, a professional web developer and book author with two decades of experience. Here you will find posts about web development, WordPress, security, and more »
Banhammer: Protect your WordPress site against threats.
Air finally clearing here in WA. Feeling grateful to breathe again. #oxygenmatters
Past week here in WA state has been hellish. So much smoke, like living in a chimney.
Now in September, I’m where I wanted to be in March.
Spent some time updating my article on unsafe characters, once again current with latest IETF specification.
Just realized that “Neo” is an anagram for “One”. As in, “he is the One” (The Matrix).
To get VLC app to load all songs (including subfolders), go to Preferences ▸ Show All ▸ Playlist ▸ Subdirectory behavior ▸ Expand.
Switching from PhotoShop to Affinity Photo is one of the most liberating work-related things I've done in 20 years.
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.