I wish to deactivate my plugin, but WITHOUT using update_option() or any other core WP function. What's the best way to go about this? Direct DB connection and modification?

3 Answers 3


The simplest way is probably renaming the plugin file or folder.

But if you're trying to handle it directly from the database, you'd have to grab the 'active_plugins' value from the wp_options table, unserialize it, remove your plugin from the array and reserialize it and update. You don't necessarily have to use update_option.

You could also look into a command line tool like WP-CLI. With that installed, deactivating a plugin is a simple command from the BASH shell, like wp plugin deactivate plugin-name.

  • Oh yeah I didn't specify... looking to do this programmatically from within the plugin itself. So yeah direct table manipulation is probably the best way to go, just wanted to make sure. Thanks!
    – JVC
    Nov 6, 2011 at 17:09

You could log into the UI and deactivate it there. Assuming you are looking for a programmatic solution, if you don't want to use any WordPress functions, your only option would be to use a direct connection to query your db.


Without knowing the context in which you're attempting to do this, it's hard to provide a lot of help. But you can deactivate a plugin via FTP by renaming the plugin's directory. WordPress will automatically deactivate it the next time it tries to load.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.