2

I used to have many plugins installed on one of my sites, and after deleting most of them, I still have a database full of extra tables, I am sure most of them are unused. How do I clean them off?

1 Answer 1

2

Backup your Database and then use DROP statements to delete the tables manually via tools such as MySQL Workbench, or MySQL Query Bench. There are many alternatives you can use that provide GUIs for backuping up, restoring, and modifying DBs.

Here's the WordPress DB schema, do not delete any of these tables:

http://codex.wordpress.org/Database_Description

Aside from that, those tables should have no impact on your site at the moment, so long as the plugins are disabled there should be no slowdown

TLDR: Backup DB, delete things, see what breaks, restore if broken

7
  • Thanks, my main problem however is how to discover which tables are no longer needed. Some of them I can identify because I am familiar with them, however other plugins create tables and I'm not aware of those. I have the same problem with the wp_options table which has become bloated.
    – urok93
    Commented Aug 20, 2012 at 11:15
  • Well you don't have to 'clean' the options table, and I'd strongly recommend against it. Take any suspect table and google for it to see which plugin it belongs to. If you delete a plugin and things break, use your backup to restore the table
    – Tom J Nowell
    Commented Aug 20, 2012 at 13:45
  • Can you not see the full list of tables?
    – Tom J Nowell
    Commented Aug 20, 2012 at 13:46
  • Ok, yes I can see the full list of tables. Isn't a bloated wp_options table bad for performance?
    – urok93
    Commented Aug 20, 2012 at 17:11
  • The only reliable way of 'unbloating' the options table is to export all your data and reimport it into a fresh install. Options table will naturally end up with a lot of entries as it's used for transients and many other things. There's no easy reliable way of determining what's left over from old plugins and what isn't
    – Tom J Nowell
    Commented Aug 21, 2012 at 7:42

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.