How To Clean Up Your WordPress Database To Improve The Speed?

clean up your wordpress database

The page loading time of your website plays an important role in many things. Whether it’s about the user experience or the SEO, the speed is everything.

The database of your website is one of the things you should take care of.

You should know how to clean up your WordPress database. It’s because whenever you update a post, make revisions and even the auto saving increases the database size.

And you know that larger database takes the time to get loaded.

You don’t even realize about the orphaned data presence in the database. Today, you will learn the best possible way to have a clean database.

What Do You Need To Optimize The Database?

If you’re thinking about anything manual then forget about it. The database is the sensitive part of your website, you can break it if you’re not a pro in MySQL and WordPress.

Well, you just have to use a plugin here.

There are many plugins in the WordPress repository but we have experienced that WP-Sweep is the best plugin to clean up your WordPress database.

Before you start, it’s always recommended to backup WordPress database.

There a few steps to take.

Step 1:- Login to your WordPress admin panel and go to Plugins>>Add New and search for WP-Sweep plugin.

Install and activate the plugin.

Step 2:- To use its service, go to Tools>>Sweep. The setting page of the plugin would open.

The first option is to optimize the post data.

Under “Post Sweep” headline, you would see the number of post revisions, auto drafts, deleted posts, orphaned meta data, and more.

optimize database

You would see the percentage which can be cured in front of every entry. Just click on the “Sweep” button to clean up that extra data from the database.

Step 3:- The next title is for the comments. You will see the number of orphaned comment meta, deleted comments, and many other things.

clean up your wordpress database

Just like above, use the “Sweep” button for each.

There is another concept here about the User Sweep.

It will show the number of users present on your website and the orphaned and duplicated user meta. It will really help you to optimize your database.

It’s because the user meta consists a ton of memory.

There are many other options if you scroll down.

NOTE :- You should always check the note provided below the “Term Sweep”. It states that if you have some posts in the draft folder then don’t use that option.

If you don’t keep the advanced posts then just click on the “Sweep” button and save the database space.

There are many other ways to improve the speed of your website. You can reduce HTTP requests or minify your website using Image sprite and more.

What Does WP-Sweep Do To Clean Up Your WordPress Database?

People always have a question about the benefits and the things a plugin does.

Well, this plugin is quite an effective one. You can see its details on the plugin page.

Let me show you the list.

  • Revisions
  • Auto drafts
  • Deleted Comments
  • Unapproved Comments
  • Spammed Comments
  • Orphan term relationships
  • Orphaned term meta
  • Orphaned user meta
  • Orphaned comment meta
  • Orphaned user data
  • Unused terms
  • Duplicate term meta
  • Duplicate comment meta
  •  Duplicate post data
  • Duplicate user data
  • Optimizes database tables
  • Transient options
  • oEmbed caches in post meta.

You will have the options for each. Whether you use one sweep button to sweep everything from your database or you can do it one by one.

This plugin is helpful because of its unique deleting functions.

Are you going to use this plugin? What are the things you’re worried about the database? I hope this tutorial will help you to clean up your WordPress database.

If you still have any question, feel free to drop a comment.

You can also connect with us on Twitter, LinkedIn, and Facebook.

by Ravi Chahar

A WordPress Professional and the LinkedIn Influencer. A coder by passion and a blogger by choice. WordPress theme development is his forte. He is your WordPress guy who will teach you how to solve WordPress errors, WordPress security issues, design issues and what not.

Get Free Updates Into Your Inbox

Learn Everything Just Like I Did



  1. Hi Ravi,

    Informative post 🙂

    This reminds me of the time when I was a newbie and had a tough time learning about the ways to clean up the database of my blog, though it was on a blogger platform, initially, till I switched over.

    I liked the way you have simplified it for all WordPress users, by sharing it all through your easy to do ways.

    Thanks for sharing. Have a nice week ahead 🙂

  2. Hi Ravi

    This much lengthy job of cleaning with this plugin! It is one of the best solutions to boost blog speed apart from removing errors and warnings.

    What do you suggest just after doing the cleaning task is it fine to keep this plugin active or better to deactivate and remove it just to lessen the burden of so many plugins as it also is a speed factor.

    Many thanks for sharing this very informative post.

  3. Hi Ravi,

    I had to thank you once again for all the help you gave me with my speed issues. I had to get some outside help but I saved all the articles you sent me and this one as well to practice on my dummy site. What stopped me from doing this myself was my confidence. That and when I called my hosting company to ask where my .htaccess file was (they changed their site around) the rep almost gasped as if it were taboo that I ask for it, lol.

    Thanks for putting this together. I’ve already passed this along!


  4. Hi Ravi!
    Good Day!

    Thank You for the great post, I have a lot of unknown files in my database which has no meaning to be there. I even reinstall my WordPress theme but these files were still there, then I got your site by searching. This helps me a lot by removing unnecessary files from DB.

    Please keep updating us with new informative things.
    Thank you for sharing with us.

Leave a Reply

Your email address will not be published. Required fields are marked *