Disable a WordPress Plugin Without Access to Your Admin Area
Normally, disabling a WordPress plugin is very simple and straightforward.
How easy? You can login to your admin area, click the “Plugins” tab and click “Deactivate” next to the plugin.
You can see an example below with Google Analytics.
However, sometimes a plugin can make things more complicated and cannot be easily disabled. This is a very useful guide to rolling back a bad WordPress plugin udpate.
Some plugins can cause problems with logging into your admin area. That’s exactly what happened to one of our members. They changed a setting inside a plugin and suddenly started getting these errors when trying to login.
So, what do you do if you can’t login to your WordPress admin and disable a plugin? You have two choices:
Option #1: Disable the Plugin Files
The easier of the two options is to disable the plugin’s files.
- Login to your site’s files using the file manager provided by your webhosting company or using an FTP program such as Filezilla.
- Browse to the /wp-content/plugins/ folder.
- Find the folder of the plugin you wish to disable.
- Rename that folder as in the image below:
Try to login to your WordPress site. You should get a message telling you that the plugin has been disabled.
Now you can set up about solving the initial problem with the plugin, either by deleting the plugin entirely or by researching and fixing the initial error.
Option #2.: Disable via the Database
The second option is more complicated and that is to disable the plugin via the database. First, you’ll need to access the database for your WordPress site. phpMyAdmin is a popular tool for this that’s provided by many hosts and it’s the one we’ll use in this tutorial.
Once you’ve logged into the database, look for the wp_options table:
You’re looking for a row with the option called active_plugins as below:
If you want to turn off all the plugins on your site, you can simply delete this entire row by clicking on the red X button beside it. This sounds like a drastic action, but isn’t really so bad and won’t cause any lasting harm. Yes, all your plugins will be disabled, you can quickly login to WordPress and re-enable them.
If you want to disable just one plugin, click on the pencil icon instead:
You’ll now see a screen like the one below:
All you need to do here is change one thing. Change the a:1 before your plugin name to a:0.
So in this example, the original line is:
You will change that to line to this one:
To save your changes and finish disabling the plugin, click Go in the bottom-right corner.
Now you can set up about solving the initial problem with the plugin, either by deleting the plugin entirely or by researching and fixing the initial error.
Thank you for this article. I was pulling my hair out trying to figure out how to access my admin area. Some wp plug-ins truly suck! Thanks again!
You’re very welcome, Matthew! Glad you got thing sorted! 🙂
You should check out our WordPress Beginner and Intermediate classes at [url=http://www.ostraining.com/online]www.ostraining.com/online[/url]
Kind regards,
Nick
THANK YOU!! Very helpful.
this tutorial not works on WordPress 3.4.1.
because there no active_plugins in wp_options table: please reply me…
i want to disable single wp plung-ins…
I have the same issue on 3.5+, and i’m re-uploading the files through ftp, if there is no luck then I hope to find the answer in this post!
Thanks
** Update **
The fix of this issue is by going to FTP/File Manager and then rename the plugins folder for example to (pluginsX), then access your wp-admin and voila it works!
Now set back the folder name to plugins, and from the dashboard you will find all the plugins are deactivated.
I strongly refer the issue to the running php version of the server, it if was higher than 5.2.17 then it will cause the blank issue.
Regards,
I had contributed the solution here but i think it was deleted by the mod.
Go to DataBase/phpmyadmin and click on search button, search the term plugin,
Browse it where ever it shows in the result.
You can find it for sure, it will be inside table_options by the way.
Thank u very much this info was extremely useful thank u again
Thanks you save me from a heart attack!!
BRILLIANT!! I used choice #2 and it works just fine. Thanks a million.
THANKS THANKS VERY VERY much, I come from Kenya and I was in q lot of stress after my site crashed,I tried several sites and they were not giving more options and step by step approach,am extremely happy,thanks
thanks a lot.
amazing answer. thanks
oh..my goddddddddddd
thanks you
thanks you!
A Twitter plug in for my wordpress (GoDaddy hosted) site would not let me access my wordpress ADMIN dashboard. Your article saved my butt. Thank you very much.
Thank you, the first method is working very fine. 🙂
I could kiss you!
WOW thanks bro!!
Thank Very Much Steve….Generally I never prefer to comment on blogs but you obliged me to comment….Thanks Again
Thank you! It has helped me.
You saved my day 🙂
If you have more than one plugin active, the database approach works a little different. You have to count down the number after ‘a:’ by one and delete the corresponding entry. For instance, to deactivate the https plugin in the following configuration
a:5:{i:0;s:59:”2-click-socialmedia-buttons/2-click-socialmedia-buttons.php”;i:1;s:29:”antispam-bee/antispam_bee.php”;i:2;s:17:”openid/openid.php”;i:3;s:65:”subscribe-to-comments-reloaded/subscribe-to-comments-reloaded.php”;i:4;s:35:”wordpress-https/wordpress-https.php”;}
change the entry to this:
a:4:{i:0;s:59:”2-click-socialmedia-buttons/2-click-socialmedia-buttons.php”;i:1;s:29:”antispam-bee/antispam_bee.php”;i:2;s:17:”openid/openid.php”;i:3;s:65:”subscribe-to-comments-reloaded/subscribe-to-comments-reloaded.php”;}
Thank you so much!!!
THANKS A MILLION!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Many many thanks
Thank you so much! Disabled it using the first method.
Saved my site…..make sure if you have mulitple plugins, you change the number at the start so it’s one less.
Before
a:29:{i:0;s:15:”worker/init.php”;i:1;s:29:”gravityforms/gravityforms.php”;i:2;s:23:”SD-mobile-nav/index.php”;i:3;s:37:”acf-options-page/acf-options-page.php”;i:4;s:29:”acf-repeater/acf-repeater.php”;
After
a:28:{i:0;s:15:”worker/init.php”;i:1;s:29:”gravityforms/gravityforms.php”;i:2;s:23:”SD-mobile-nav/index.php”;i:3;s:37:”acf-options-page/acf-options-page.php”;i:4;s:29:”acf-repeater/acf-repeater.php”;
Hi, It’s anyway to do this around? To get the code line to activate a specific plugin? Imagine W3 Super Cache is installed but not active and we wanna do this way, through phpmyadmin without having the option_value for that plugin. Thank you.
I cannot say thank you enough. I totally bombed my site and this fixed it!
Amazingly simple and worked fantastic! Thanks for the tip!
Thank so much for taking the time to help me and other. Well explained. You gave me back my WP! 🙂
if you have access to console, just install wp-cli and run `wp plugin deactivate %plugin_name%`
Thanks a ton… That was actually a life saver .. Wp-cache-plugin was driving me crazy..
Thank you so much! It just saved my life!
Thanks for the tip.
Yes!! Yes!! Thank you so dearly much! Bless you
Thank you!
Sure thing, glad it was useful
I used option 1 and it worked, was able to log into back end.
Then while in back end went back to ftp and removed the word disabled and tried to activate plugin but got a message saying:
Plugin could not be activated because it triggered a fatal error.
Warning: require_once(/home/content/p3pnexwpnas04_data02/85/3015185/html/wp-content/plugins/photo-gallery-free-dev-9196c242eefda8c0dd0e9a98a6e4fb938e2b07bf/framework/BWGOptions.php): failed to open stream: No such file or directory in /home/content/p3pnexwpnas04_data02/85/3015185/html/wp-content/plugins/photo-gallery-free-dev-9196c242eefda8c0dd0e9a98a6e4fb938e2b07bf/photo-gallery.php on line 43
Fatal error: require_once(): Failed opening required ‘/home/content/p3pnexwpnas04_data02/85/3015185/html/wp-content/plugins/photo-gallery-free-dev-9196c242eefda8c0dd0e9a98a6e4fb938e2b07bf/framework/BWGOptions.php’ (include_path=’.:/usr/local/php5_6/lib/php’) in /home/content/p3pnexwpnas04_data02/85/3015185/html/wp-content/plugins/photo-gallery-free-dev-9196c242eefda8c0dd0e9a98a6e4fb938e2b07bf/photo-gallery.php on line 43
Hi D,
Please make sure you’re running the latest version and/or contact the developer of the photo-gallery-free plugin about the bug. They’ll be able to get it fixed for you.
So glad I found this article. This solution helped me solve the locked out site, plugin error message within minutes.
Thank you for this article – it was very helpful. the plugin was pulling my site down.
Thanks for this article, it saved my bacon, eggs and mushrooms. Very helpful!
Thank You. Akismet update blew up on me and renaming it saved my bacon.
Brilliant thank you!
This is very important interview question ,I have asked more time. Thank you very much
Thank you for this great article! It saved me.
Activated a plugin and got locked out from the admin area.
Thank you SO MUCH. I just installed the “Simple LDAP login” plugin, and the “LDAP exclusive” option was turned on by default. When I logged off I could no longer log in.
You literally saved my life, I’ll give you a cookie.
This article is very misleading. The approach described here only works if you have only 1 plugin activated. The data the author is manipulating is a serialized PHP array. Changing the “a:1” to “a:0” truncates the array telling PHP/WP that the array is empty. If you have more than one plugin installed it will disable all of your plugins not just a single one as the title implies. Manually editing a serialized object is possible but only if you fully-understand the syntax of the serialized object. It is also very risky. It would be better to deleted everything from “i:0; s:19:”akismet/askisment.php”;
In a serialized object, the “a:1” means “This is an array with 1 item”. Inside the array, the “i:0” means “Integer 0” (or the 0th index of the array). The “s:19” means “What follows is a string 19 characters long”.
No doubt that this article has caused a lot of frustration for a lot of people who thought changing a single character would disable a single plugin.
Thank you option #2 worked for me
Thanks a lot. Option 1 works for me
Thank you for this as for some reason I was not able to get rid of a certain plugin, and messing it around with it for way to long, and got this voila and it was gone.Thanks
Thank you, this was very helpful!
This article was incredibly helpful. Thank you!
great it works with rename of folder -disabled
Thank you for this article.
I was completely blocked by from my admin because I forgot my Shield password. Searched online and this is the only thing that saved me. Thanks so much for this great guide. I’m hopeless at databases, but your guide is just simply easy and brilliant! Will reinstall shield and ensure a password that I have written down and can remember. Even deleting Shield by ftp doesn’t disable it!!!!!!