Here are some of the best cleanup and optimization plugins available in the WordPress plugin directory. Some of these serve a specific purpose — the plugin for removing broken links for instance — while some others perform multiple optimization routines at the same times.
WP-Sweep allows you to clean up unused, orphaned and duplicated data in your WordPress. It also optimizes your database tables.
WP-Optimize is WordPress’s most-installed optimization plugin. With it, you can clean up your database easily and safely, without manual queries.
Broken Link Checker will check your posts, comments and other content for broken links and missing images, and notify you if any are found.
EWWW Optimizer will automatically optimize your images as you upload them to your blog. It can also optimize the images that you have already uploaded and convert your images automatically to the file format that will produce the smallest image size.
DNUI (Delete Not Used Image) will search images from the database and try to find it on every post and page. If one image has one reference in this either post or page, the plugin will tell you that the image is used.
Bulk Delete is a WordPress Plugin that allows you to delete posts, pages, attachments, users and meta fields in bulk based on different conditions and filters.
Mass Delete Unused Tags deletes all unused tags. Handy tool if you want to start over with a quick clean blog.
Image Cleanup will index unreferenced images. These can be leftovers from cropping and scaling images. Stop them from cluttering your content folder.
Content audit lets you create a content inventory right in the WordPress Edit screens. You can mark content as redundant, outdated, trivial, or in need of a review.
Export all URLs allows you to extract posts/pages Title, URL and Categories. You can write output in CSV or in dashboard.
Spam Comments Cleaner deletes all the SPAM comments of your WordPress site in a regular time interval.
Delete All Comments Easily helps you in deleting all the comments (Approved, Pending, Spam and Trashed Comments) from your website or you can just delete all the pending comments