Advanced Database Cleaner will help you remove all those leftovers and perform a deep database clean-up and optimization (you can download the free version from wordpress.org).
Advanced DataBase Cleaner PRO GPL
Do you know that even after deleting a plugin/theme from your WordPress website, some of its leftovers may remain in your database? Such as orphan options, orphan tables, and orphan cron tasks. As you may know, not all plugins/themes care about the housekeeping of your WordPress database.
As long as you are removing plugins/themes, leftovers will be accumulated in your database and will influence your website performance. You should clean this unnecessary data to reduce the size of your database and improve efficiency when accessing tables. In addition, your backup files will be quicker and smaller.
The Pro version of Advanced Database Cleaner will help you remove all those leftovers and perform a deep database clean up and optimization (you can download the free version from wordpress.org).
Clean up Posts Table
Delete old revisions of posts and pages,
delete old auto drafts & delete trash posts. This will help reducing the size of your “posts” table
Clean up Comments Table
Delete pending comments, spam comments, trash comments, pingbacks and trackbacks. This will reduce the number of rows in your “comments” table
Clean up Orphaned Metadata
Delete orphan post metadata, orphan comment metadata, orphan user metadata, orphan term metadata and orphan relationships
Display & View Orphaned Items
View details about orphaned item before making a database clean-up so you can be sure about what you are going to clean-up
Keep Last x Days’ Data
You can keep the last x days’ data from being cleaned and clean up only data older than the number of days you have specified
View & Manage Tables
Display tables information such as the number of rows, table size, etc. Optimize tables & repair corrupted ones. You can also empty and delete tables if needed