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.
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.
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
: