How to Disable the WordPress Plugin from the Database?

Today I am going to show you how to disable WordPress plugin from the database easily.

You must be surprised why I am talking about disabling from the database when we can deactivate plugins from the WordPress admin.

Deactivating a plugin from admin is the best and easiest way and recommended too. But disabling plugin from the database is useful when you are not able to login to your admin.

Here is what happened to one of my friend’s WordPress sites.

One day suddenly the website started throwing this error message.

The WordPress fatal error
The WordPress Fatal error: Uncaught ArgumentCounterError: Too few arguments to function wpdb::prepare()

You can see in the screenshot it was due to the ‘wuk.ch DNS-Prefetch / Prerender’ plugin he was using for DNS prefetch, HTML5 Prefetch, and Google Prerender.

The WordPress login screen was also throwing the same error. Here is a screenshot.

WordPress plugin error login screen
WordPress plugin error on the login screen.

Due to this error admin was not accessible. He approached me to fix it.

What I did to fix this problem?

I just disabled all plugins installed on his WordPress site from the database.

Let’s see how you can do it yourself.

If you have hosted more than one site on the same hosting account than you must know what your database name is.

It’s easy to know the WordPress database name. You can check the DB_NAME variable in the WordPress configuration file (wp-config.php).

Disable WordPress plugin from PHPMyAdmin

Method 1

Here are simple steps to disable the WordPress plugin from the database without accessing your admin area.

  1. Log on to your cPanel account. For most hosting companies’ cPanel URL is yourdomain.com/cpanel.
  2. Go to database section and click phpMyAdmin.
  3. In the left pane of phpMyAdmin, click on your WordPress database.
  4. Look for the wp_options table then find the option active_plugins. In my case, it was looking like this.
    Active Plugin Code
  5. To disable all plugins, you can simply delete the code and hit the ‘Go’ button.

Method 2

Log into your cPanel account, go to the database section and open phpMyAdmin.

Click on the SQL tab and copy-paste the following code in the text area.

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

In case your WordPress database table prefix is not ‘wp_’ , replace ‘wp_’ with your table prefix.

Click the ‘Go’ button.

This will disable all active plugin of your WordPress site.

Leave a Reply

Your email address will not be published. Required fields are marked *