I have installed a plugin following wp plugin install ... CLI command and then activate through CLI command its working properly. But problem is that when I deactivate then delete the plugin the table which is related to this plugin is still in my database. Is there any way to delete the unused unnecessary tables from wp database?

That is the responsibility of the author of the plugin. Amazingly some authors believe that it is wrong to delete information from the DB, which I personally find unbelievable, but I guess there are all kinds of users that do not think or backup before they delete things, and they were crying for such functionality (i.e., for plugins to not delete DB on plugin delete).

  • 2
    as a note: some things are really not trivial to delete, as they might get used in other contexts as well. Creating a DB structure that is easy to delete is not always a simple task. – Mark Kaplun Mar 17 at 7:53

wp-cli does not have a feature in it that enables you to delete a specific table; you can only delete the entire database.

You'll have to manually delete the table through SQL.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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