I have a wordpress script, wp-supercache, that I need to disable (as its cached on a nasty error), however, the error is causing the wp-admin redirect to fail, which means I can’t get into the site to disable the plugin.
Any advice? I can access the database via cpanel.
Try re-naming the folder of the plugin and then see if error is gone (make backup first of course.). If that does not help, here is the solution then.
To disable a specific plugin, you have to remove it from the serialized string that stores the list of all plugins – that’s set in the
option_value
column of thewp_options
table as discussed by @TimDurden. The specific format change you have to make is, taken shamelessly from teh Internet:That first set of characters –
a:4
– designates an array and its length. Note also that each line in the list of plugins has an index. So:i:
Update the value in the db using the new string you constructed from these steps:
Note that your table name might not be wp_options – you might have a prefix to add.
You only need to rename the folder in /wp-content/plugins/ and the plugin will be automatically de-activated. Once it is de-activated, you will be able to login.
Copy the serialized result string from the right side and update active_plugins value with it.
I wrote a little exe in .dot to repair/remove options string from database.
To disable all WordPress plugins on your site:
UPDATE wp_options SET option_value = '' WHERE option_name = 'active_plugins';
Another way to do this is you can backup the site and then just rename the folder of the plugin under /wp-content/plugins/ to some other name . So the plugin will be disabled.
I wont prefer deleting the plugin folder as it may cause errors.
After the step is done log in to your wordpress site and delete the plugin from there
You just need to change the values in the record “active_plugins” in the database. You can find the process Here
Late answer,but answering as it will be useful to someone in the future. All the plugins are stored in the wp_options table in a serialized manner. U can edit this field manually. Or if you unserialize it using a function like in php using unserialize(), you will get an array. just modify it to remove the plugin you want to remove from that array, and serialize it back. then update the table. Thats it. If you want to know more about it here is a good article. It explains all about this.
Using this code you can activate your plugin from the
functions.php
: