How to Disable or Enable All WordPress Plugins and Theme via the Database

This article explains how to deactivate, change or delete themes and plugins on a WordPress site without the dashboard. This may be helpful if you have a plugin or theme that has malfunctioned and caused you to lose access to the dashboard.

Deactivating a Plugin

These steps explain how to deactive plugins on a WordPress site without the dashboard.

Note: This will deactivate all plugins, however it does not remove the plugin, or its settings.

First open phpMyAdmin for access your database.

Clearing Active Plugins

1. In phpMyAdmin find your WordPress database in the list of databases.

2.In the list of tables click on the table name that ends with “options”.

3.In the options table click on the column heading “option_name” to sort the table rows by name. This should make active_plugins the first table row.

4.Click the edit link on the active_plugins row.

5.Clear out all text in the option_value box.

6.Click the “Go” button at the bottom.

You should get a page indicating that the query was executed. You are finished, all plugins should now be disabled in WordPress.

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

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

Changing the WordPress Theme

These instructions will explain how to change the theme setting in WordPress without the WordPress dashboard.

1. In phpMyAdmin find your WordPress database in the list of databases. In this case our example database is examplec_wo5647.

2.In the list of tables click on the table name that ends with “options”.

3.In the options table locate the rows for template and stylesheet. They are usually on the second page and their option_id will be around 40.

4.Click edit to change both the theme and stylesheet’s option_value to the theme you wish to use. This should be the exact, case sensitve name of the folder inside wp-content/themes that contains the theme you want to use.

5.Click the “Go” button.

The theme should now be set to your chosen theme.

Leave a Reply