How to Disable WordPress Plugins from the Database

How to Disable WordPress Plugins from the Database

Often, a malfunctioning plugin is the cause of a WordPress website not functioning. Disabling the faulty plugin solves the problem.

After disabling the plugin, download and install it again to make the entire site work as it should.

The admin area of WordPress is the right location to disable a plugin. However, issues with a plugin can cause the WP admin page to function incorrectly or not at all.

So, if the WordPress dashboard is working as normal, it is easy to disable a plugin. But when it is down, a website manager needs a different method to turn off a defective plugin.

An alternative method is to disable it from the WordPress database. Before attempting to make any changes to the database it is best to first use phpMyAdmin to back it up.

This post will show how to disable WordPress plugins from the database.

Why Disable a WordPress Plugin

This post discusses the main reason above. WordPress plugins can stop working for some reason and cause the whole site to stop working.

So, preventing website downtime is the primary reason to deactivate a plugin. Sometimes it’s necessary to do this before a plugin starts causing trouble.

Related to this are website security reasons. A malfunctioning plugin can cause a breach in the safety of a website.

Besides eliminating a plugin, WordPress offers the option of deactivating one. Uninstalling a plugin is not always the best option, especially if the plugin is useful in the short term.

If the plugin is not needed for some time, turning it off is a good option. Deactivating a plugin is also a practical approach to finding out if it is the root cause of problems on a website.

If the problems disappear after deactivating a plugin, it is clear that that one is the culprit. The next step is then deleting it.

The problem caused by a faulty plugin may be so deep that the WordPress dashboard becomes inaccessible.

Some errors, like 502 and 504, are not straightforward to fix. Again, it could be a plugin that is causing them.

Generally speaking, whenever a plugin is failing it is a good idea to try and deactivate them.

When identifying which of the plugins is at fault, the easiest and fastest approach is to deactivate them one by one. This approach is better than deactivating them all at the same time.

Deactivating them all at the same time makes the identification process harder. It may even cause more problems with the WordPress site.

Disable Plugin via the Database

The WordPress Database plays a central role in the functioning of a WordPress site. It contains all the basic information for its functioning.

The status of plugins is also controlled from there. So, disabling a plugin is quite straightforward using the database.

All that is necessary is a program like phpMyAdmin. This is available from the web host’s control panel and allows access to the database.

Why through the Database

The main advantage of making changes through the database is that it does not alter the file structure.

Changing the name of the plugins folder will also deactivate them. But it has many other unwanted side effects too.

So, the backdoor solution of disabling plugins in the database is much faster and sager.

Quick Steps

  • Login to cPanel
  • Go to File Manager

  • Use the wp-config.php configuration file to identify the database in question. The wp-config.php is in the website’s root documents.
  • Go to phpMyAdmin.

  • Select the Database
  • Click the table with the label wp_options

  • Go to active_plugins

  • To disable a plugin change its option_value to a:0:{}
  • Save the changes

Access the Database

The phpMyAdmin is a popular tool for accessing a WordPress Database. Most hosts include it in their control panels and it is what this article uses too.

The wp-config.php file contains most of the configuration settings of the website. It contains a variable DB_NAME that specifies the database name.

Check it if in doubt about the exact name that is in use for the specific website.

Usually, this file is in the document root directory. Use the File Manager under Site Tools to open it.

After opening phpMyAdmin go to the left panel to select the WordPress database.

Open options Table

To make changes to the database, open phpMyAdmin through cPanel. Locate the desired database and click the +-sign next to it.

This will unfold a menu that shows all the tables in that database. Go to the table with the name wp_options.

It is possible that the name’s prefix is different, for example, wppa_options.

Now, on the right, a list of table rows will appear. In this list find active_plugins.

It will be on the second page under option_name.

For each plugin, there is an option_value section. Copy this part and save it somewhere.

This makes it easier to return to the original value. Having completed these steps it is time to make changes.

Edit active_plugins Value

Now one can start editing. To start editing, click the Edit button for the specific row.

There is also a red X button. Clicking the red button will delete the whole row.

This does not mean that it will delete the whole plugin, but it does deactivate them. Use WordPress to enable them again.

To disable the plugin replace the content under option_value with a:0:{}. The number after “a:” is the number of plugins that are currently enabled.

So, if there are two active plugins, the option_value should start with a:2.

That means that, if disabling one plugin, the value should change from a:n to a:n-1, where n is the number of active plugins. Below is a practical example, where the number of active plugins is 5:


To deactivate all plugins use the value a:0:{}.

Below is the same line where one plugin, the Akismet plugin used in the example above, is turned off:


After making all changes, save them. The plugin or plugins are then deactivated.

It is important to note that the prefix of the table’s name does not always start with wp_.

Use the phpMyAdmin tool to check the correct prefix. It will appear after selecting the WordPress database.

Now open the website. If the broken plugin was deactivated, the website should function correctly now.

That means that the dashboard should also be accessible again.

This is handy to reactivate the plugins again one by one. If the website stops functioning again, this identifies the guilty plugin.

Return to the database to disable WordPress plugins to reactivate the site again. Then uninstall the plugin and look for a replacement.

Ending thoughts on how to disable WordPress plugins from the database

Troubleshooting can be difficult for a WP admin. Sometimes the problem is with one of the WordPress plugins.

When one is malfunctioning it can take the entire website down. The solution is to disable them.

The easiest way is by using the WordPress admin panel. But with a faulty plugin, this may not be accessible.

So being familiar with an alternative method is useful. Doing it through the database is not as hard as it seems.

A disabled plugin is not deleted from WordPress, it is only deactivated. Later, when appropriate, it is possible to enable it again from the admin area.

If you enjoyed reading this article on disable WordPress plugins from the database, you should check out this one about how to make a phone number clickable in WordPress.

We also wrote about a few related subjects like how to check the WordPress versionhow to upload an HTML file in WordPresshow to embed a Facebook video in WordPresswhere are WordPress pages storedwhy is WordPress so hard to usehow to hide the author in WordPress and how to delete WordPress themes.

Up Next:

How to Edit Categories in WordPress Easily

How to Edit Categories in WordPress Easily