Deactivate And Activate All Plugins Of WordPress Via Database Or PHPmyadmin



Wordpress Development

Hi Friends, In this article I am going to explain you how we can enable or disable all wordpress plugins via database or phpmyadmin. Now you ask why you want to do this via database and phpmyadmin because we can do it via wordpress admin, but I need this because I was not able to login into admin of wordpress and that is because of one plugin, One plugin having problems in some code and that’s why it was giving error on admin main page and not showing login page, So it was little bit critical and I need to solve it asap. I was not able to login in admin, So it is not possible for me to deactivate plugin via admin and thats why I need to deactivate all plugins via database or phpmyadmin.

So to do this I open phpmyadmin or our database in any other interface. then I find ‘active_plugins’ option name in ‘wp_options’ table by query given below :

SELECT * FROM wp_options WHERE option_name = 'active_plugins';

Now when I found this row by above query I clicked on edit to edit this row. When I clicked on edit I found one string in ‘option_value’ field given below :

a:18:{i:0;s:19:"WPRobot/wprobot.php";i:1;s:19:"akismet/akismet.php";i:2;s:43:"all-in-one-seo-pack/all_in_one_seo_pack.php";i:3;s:43:"broken-link-checker/broken-link-checker.php";i:4;s:45:"cbnet-ping-optimizer/cbnet-ping-optimizer.php";i:5;s:25:"commentluv/commentluv.php";i:6;s:49:"delete-duplicate-posts/delete-duplicate-posts.php";i:7;s:37:"facebook-fan-box/facebook-fan-box.php";i:8;s:36:"google-sitemap-generator/sitemap.php";i:9;s:31:"page-links-to/page-links-to.php";i:10;s:21:"pagemash/pagemash.php";i:11;s:29:"sem-dofollow/sem-dofollow.php";i:12;s:39:"si-captcha-for-wordpress/si-captcha.php";i:13;s:35:"si-contact-form/si-contact-form.php";i:14;s:51:"sociallist-social-bookmarking-widget/sociallist.php";i:15;s:35:"thesis-openhook/thesis-openhook.php";i:16;s:21:"wp-cache/wp-cache.php";i:17;s:29:"wp-db-backup/wp-db-backup.php";}

Above string is showing me activated plugins on my website, in your case it might be different because it is obvious that you are using different plugins then me. Now cut that string from there and saved it anywhere for later use when we want to enable all plugins again. Now after cut that string from ‘option_value’ save it and then I try to access site, Voila! that plugins error gone because i deactivated all plugins by phpmyadmin.

Now if I want to activate or enable all plugins again via phpmyadmin or database then do same things and after clicked on edit just paste that string to ‘option_value’ which saved for later use. In this way you can activate all plugins again by phpmyadmin or database.

Second method to deactivate or disable all plugins is just rename ‘wp-content/plugins/’ folder. You will have to manually reactivate the plugins after you rename the plugins folder back to its original name, but all plugin options are preserved too.

I hope this post helpful for someone. If you have any question then you can ask me anytime or post it in comment.

Also I am WordPress Developer, Freelance PHP Developer having more than 3 years of experience, So if you want to do any projects then you can contact me.

Hostgator Hosting in 1 Cent Coupon Code – “1CENTHECOUPON” (Without Quotes).

  • Allampatu

    how can i do if i would like to activate just one plugin?

    • http://www.joomladesignservices.com/ Joomla CMS

      Yes,Deactivate and activate all plugins

  • http://www.geekrevealed.com/ Geek Revealed

    Great tip! It will be quiet useful to me and I am surely gonna try this out.
    Well Thanks for sharing!

  • http://www.mydiscoutlet.com/products/cd-replication/ CD Copies

    I really liked the article and also the tips, very cool blog

  • Vedvard

    You are a very persuasive writer. How do I know? Because I am usually unwaivering when it comes to my opinions. You made me rethink my thoughts on this topic. Thanks a lot for the article.