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.
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.
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.
- Log on to your cPanel account. For most hosting companies’ cPanel URL is yourdomain.com/cpanel.
- Go to database section and click phpMyAdmin.
- In the left pane of phpMyAdmin, click on your WordPress database.
- Look for the wp_options table then find the option active_plugins. In my case, it was looking like this.
- 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.