How To Reduce WordPress Database Size To Improve Blog Performance

How To Reduce WordPress Database Size To Improve Blog Performance
Like Tweet Pin it Share Share Email

There are two important components of a typical WordPress installation:

  • WordPress files stored on your server
  • WordPress database

It’s very essential for you to clean up your WordPress database and reduce its size from time to time.

Over time, your WordPress database has accumulated many redundant tables, unused records, and many entries which you can remove without affecting your website.

This is a must-do process for every WordPress user to keep the size of their database at a minimum and keep their WordPress blog loading quickly.

This will help reduce the load on your server and your WordPress performance will improve dramatically.

In this tutorial, I will take the example of PeopleThink’s WordPress database which is 286.3 MB and drastically reduce it’s size. 

You can follow this guide step-by-step and perform these tasks on your own blog.

Note: A few of the points require a little technical know-how, and if you find yourself questioning, feel free to ask in the comments or skip that step entirely. 

Tutorial: How to Reduce WordPress Database Size

 

Step 1: Take WordPress Database Backup (IMPORTANT)

Taking WordPress Database Backup

This is the most essential step.

In my case, I have used my hosting company’s backup feature (WPEngine backup) to take a complete backup of the database and all included files.

You can also use the WP-db manager plugin to take a backup of your database file. You can find a tutorial over here. I highly recommend the WP-db manager plugin because we will be needing to run a few SQL queries, empty, and drop database tables(all of which this plugin can do).

Step 2: Disable AND Delete Unused WordPress Plugins

delete unused WordPress plugin

Go through the active plugin list on your WordPress blog and disable those plugins which you are not using anymore. There might be plugins that you use once in a while, but I suggest you disable them now and re-install them when they’re needed again.

Our goal for today is to completely optimize the database size.

Only disabling unused plugins will not be of much help here, so make sure you also delete those unused plugins.

Speaking of useful plugins:

  • Basic WordPress Plugins For Every Blog
  • Must Have SEO WordPress Plugins
  • List Of Plugins That I Use Here At PeopleThink

Step 3: Delete All Spam Comments, Trash Posts, and Post Revisions

Whatever comments you have in your spam and trash folders, delete them.

Similarly, delete all posts from the trash folder and delete all post revisions.

cleanup-wordpress-database

 

Step 4: Find and Clean Orphan Tables

orphan-wordpress-tables

Install the WP Advanced database cleaner WordPress plugin & and follow this tutorial.

This plugin will find orphan and unused tables in your database. Using this plugin will help you clean all such tables.

This is a quite critical step and do it only when you are sure of the table names which you are not using.

If you are confused, skip this step.

  • Note: Deactivate the plugin after using it.

 

Step 5: Remove Unused Meta Values From Database 

(Caution: Technical knowledge needed)

This is something I do once a year and suggest you do it only if you are accustomed with phpMyAdmin.

If you have used phpMyAdmin before, simply follow this easy tutorial and get rid of all unused meta values from your database.

This won’t bring down your database size significantly, but it is useful if you are highly determined to clean up your WordPress database.

Step 6: Use MySql Queries To Reduce Database Size

One of the tables which is a major cause of increased database size is “wp_commentmeta” due to the Akismet plugin.

Before running the below mentioned query, my wp_commentmeta size was 146 MB.

After optimizing, it reduced to 16.1 MB.

Here are two queries which you need to run. Use the WP-db manager plugin > Run SQL query option to execute these queries from the WordPress dashboard.

  • Run both SQL commands separately.

DELETE FROM wp_commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM wp_comments);
DELETE FROM wp_commentmeta WHERE meta_key LIKE '%akismet%';

Note: For some WordPress installations, there is a chance your database table names might be different from what is used in the above code. It could be something like “wp_commentsmeta”, so don’t forget to check your DB table names and replace them accordingly.

Here are couple more SQL queries which will be useful to reduce database size:

DELETE FROM wp_postmeta WHERE meta_key = "_edit_lock";
DELETE FROM wp_postmeta WHERE meta_key = "_edit_last";

Step 7: Empty and Drop Unused Database Tables

Again, this step is for those WordPress users who have a fair knowledge of WordPress tables.

Under the WP-db manager plugin, you will find an option to “Empty/Drop Table” and from there you can see the list of all the tables in your WordPress DB.

Here you can empty those logs which are not useful and drop those tables which were created by any plugins that you are not using anymore.

For example, I removed “wp_roostsettings” which was created by one of the plugins I deleted in Step 2.

Step 8: Optimize Database and Be Amazed

If you have followed all of the above steps as mentioned, it’s now time to optimize your database and see how much size you have freed up.

You can optimize your database using the “Optimize” option of the WP-db manager plugin or you can use the WP optimize plugin. I have shared a guide before on database optimization here.

As mentioned above, my WordPress database size was 286 MB before cleaning up and after all of the above-mentioned steps, my database size dropped to 96.7 MB.

That’s a huge reduction of 189 MB!

Overall, if you have a busy WordPress site, you should clean your WordPress database once every 2 months, or at least optimize your WordPress database once every 2 weeks.

Go ahead and start working on reducing your WordPress database size and let me know how much space it was before and how much space it is now.

Speaking of fine-tuning your WordPress blog:

  • How To Make Money From Your WordPress Blog
  • How To Fix All Broken Links Using The Broken Link Checker Plugin
  • A DIY Guide To WordPress Search Engine Optimization

Comments (4)

  • I simply want to mention I am just very new to weblog and actually savored you’re web page. Probably I’m planning to bookmark your site . You actually have exceptional well written articles. Kudos for sharing your web page.

    Reply
  • Wow! Thank you! I constantly wanted to write on my blog something like that. Can I take a portion of your post to my site?

    Reply
  • I’ve been absent for a while, but now I remember why I used to love this web site. Thank you, I¡¦ll try and check back more often. How frequently you update your web site?

    Reply
  • It is actually a great and helpful piece of info. I am satisfied that you just shared this useful information with us. Please stay us up to date like this. Thanks for sharing.

    Reply
  • This is really interesting, You are a very skilled blogger. I have joined your feed and look forward to seeking more of your great post. Also, I’ve shared your website in my social networks!

    Reply
  • Wow, marvelous blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your web site is wonderful, as well as the content!

    Reply
  • We are a group of volunteers and starting a new scheme in our community. Your web site provided us with valuable info to work on. You’ve done an impressive job and our whole community will be grateful to you.

    Reply
  • Hey There. I found your blog using msn. This is an extremely well written article. I’ll make sure to bookmark it and return to read more of your useful information. Thanks for the post. I will certainly comeback.

    Reply
  • I must show my respect for your generosity giving support to women who have the need for help with your content. Your real commitment to getting the solution up and down was really valuable and have all the time empowered people just like me to realize their ambitions. Your entire warm and helpful publication signifies a lot to me and even more to my colleagues. Regards; from each one of us.

    Reply
  • We are a group of volunteers and starting a new scheme in our community. Your web site provided us with valuable information to work on. You’ve done an impressive job and our entire community will be thankful to you.

    Reply
  • My wife and i were so delighted John managed to finish off his investigation with the ideas he received through your weblog. It’s not at all simplistic to just happen to be handing out information and facts the rest have been making money from. And we fully grasp we now have the writer to thank for that. The specific explanations you have made, the straightforward site menu, the friendships you will help to promote – it’s got everything terrific, and it’s really making our son and us know that that subject matter is interesting, and that’s incredibly essential. Thanks for the whole lot!

    Reply
  • You really make it appear so easy with your presentation but I find this matter to be actually one thing which I think I’d by no means understand. It sort of feels too complicated and very huge for me. I’m having a look ahead on your subsequent submit, I¡¦ll try to get the hold of it!

    Reply
  • Its like you read my mind! You seem to know a lot about this, like you wrote the book in it or something. I think that you could do with a few pics to drive the message home a little bit, but other than that, this is excellent blog. A great read. I’ll definitely be back.

    Reply
  • Hey There. I found your blog using msn. This is a really well written article. I’ll make sure to bookmark it and return to read more of your useful info. Thanks for the post. I’ll definitely comeback.

    Reply
  • Well I definitely enjoyed reading it. This information provided by you is very effective for good planning.

    Reply
  • Thank you for sharing superb informations. Your site is so cool. I’m impressed by the details that you¡¦ve on this blog. It reveals how nicely you perceive this subject. Bookmarked this web page, will come back for more articles. You, my friend, ROCK! I found simply the information I already searched everywhere and just could not come across. What a perfect web site.

    Reply
  • I don’t even know how I ended up here, but I thought this post was good. I do not know who you are but certainly you are going to a famous blogger if you are not already 😉 Cheers!

    Reply
  • hey there and thank you for your information – I’ve definitely picked up something new from right here. I did however expertise some technical issues using this website, as I experienced to reload the website lots of times previous to I could get it to load correctly. I had been wondering if your web host is OK? Not that I’m complaining, but sluggish loading instances times will often affect your placement in google and can damage your high quality score if ads and marketing with Adwords. Anyway I’m adding this RSS to my e-mail and can look out for a lot more of your respective interesting content. Ensure that you update this again soon..

    Reply
  • Excellent goods from you, man. I have understand your stuff previous to and you’re just too wonderful. I really like what you have acquired here, really like what you’re saying and the way in which you say it. You make it entertaining and you still take care of to keep it sensible. I cant wait to read far more from you. This is actually a wonderful site.

    Reply
  • As I site possessor I believe the content material here is rattling magnificent , appreciate it for your efforts. You should keep it up forever! Best of luck.

    Reply
  • You could certainly see your enthusiasm in the work you write. The sector hopes for more passionate writers like you who aren’t afraid to mention how they believe. At all times follow your heart.

    Reply
  • Super-Duper blog! I am loving it!! Will be back later to read some more. I am bookmarking your feeds also

    Reply
  • Great blog right here! Additionally your web site a lot up fast! What host are you using? Can I am getting your affiliate link in your host? I want my website loaded up as fast as yours lol

    Reply
  • Excellent read, I just passed this onto a colleague who was doing some research on that. And he just bought me lunch because I found it for him smile So let me rephrase that: Thanks for lunch!

    Reply
  • You made some good points there. I looked on the internet for the topic and found most persons will consent with your blog.

    Reply
  • hey there and thank you for your information – I’ve definitely picked up something new from right here. I did however expertise a few technical points using this website, as I experienced to reload the web site many times previous to I could get it to load properly. I had been wondering if your web hosting is OK? Not that I am complaining, but sluggish loading instances times will often affect your placement in google and could damage your quality score if ads and marketing with Adwords. Well I am adding this RSS to my email and could look out for much more of your respective fascinating content. Ensure that you update this again soon..

    Reply
  • Great ¡V I should certainly pronounce, impressed with your website. I had no trouble navigating through all tabs as well as related info ended up being truly simple to do to access. I recently found what I hoped for before you know it at all. Reasonably unusual. Is likely to appreciate it for those who add forums or something, web site theme . a tones way for your customer to communicate. Nice task..

    Reply
  • Whats up very nice web site!! Guy .. Beautiful .. Amazing .. I’ll bookmark your website and take the feeds additionally¡KI’m happy to find numerous useful info right here within the publish, we need develop more techniques on this regard, thanks for sharing. . . . . .

    Reply
  • I¡¦ve read some excellent stuff here. Certainly value bookmarking for revisiting. I wonder how so much effort you place to make this type of fantastic informative website.

    Reply
  • Whats Happening i am new to this, I stumbled upon this I’ve found It absolutely helpful and it has helped me out loads. I hope to give a contribution & assist different customers like its aided me. Great job.

    Reply
  • I have to get across my admiration for your generosity in support of those people that should have assistance with in this subject matter. Your very own commitment to passing the message all over appears to be definitely insightful and has surely empowered employees much like me to arrive at their pursuits. Your amazing interesting help and advice means much to me and still more to my mates. Regards; from everyone of us.

    Reply
  • I haven¡¦t checked in here for some time because I thought it was getting boring, but the last few posts are good quality so I guess I¡¦ll add you back to my daily bloglist. You deserve it my friend 🙂

    Reply
  • Attractive section of content. I just stumbled upon your website and in accession capital to assert that I acquire actually enjoyed account your blog posts. Any way I’ll be subscribing to your augment and even I achievement you access consistently rapidly.

    Reply
  • I have not checked in here for some time as I thought it was getting boring, but the last few posts are great quality so I guess I will add you back to my daily bloglist. You deserve it my friend 🙂

    Reply
  • Thank you for every other informative blog. Where else may just I am getting that type of information written in such a perfect approach? I have a venture that I’m simply now running on, and I have been on the look out for such info.

    Reply
  • I am not sure where you are getting your information, but great topic. I needs to spend some time learning much more or understanding more. Thanks for wonderful information I was looking for this information for my mission.

    Reply
  • Excellent read, I just passed this onto a colleague who was doing a little research on that. And he actually bought me lunch since I found it for him smile So let me rephrase that: Thanks for lunch!

    Reply
  • you are in point of fact a just right webmaster. The website loading pace is amazing. It kind of feels that you’re doing any unique trick. Moreover, The contents are masterwork. you have done a excellent activity in this subject!

    Reply
  • Hi there, just became aware of your blog through Google, and found that it’s truly informative. I am gonna watch out for brussels. I will appreciate if you continue this in future. Numerous people will be benefited from your writing. Cheers!

    Reply
  • Good ¡V I should certainly pronounce, impressed with your web site. I had no trouble navigating through all the tabs as well as related information ended up being truly simple to do to access. I recently found what I hoped for before you know it at all. Reasonably unusual. Is likely to appreciate it for those who add forums or something, web site theme . a tones way for your client to communicate. Excellent task..

    Reply
  • Wow, superb blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your website is great, as well as the content!

    Reply
  • I like what you guys are up also. Such clever work and reporting! Carry on the excellent works guys I have incorporated you guys to my blogroll. I think it’ll improve the value of my web site 🙂

    Reply
  • Very well written post. It will be helpful to anyone who employess it, as well as me. Keep up the good work – i will definitely read more posts.

    Reply
  • Good site! I truly love how it is easy on my eyes and the data are well written. I am wondering how I might be notified whenever a new post has been made. I’ve subscribed to your feed which must do the trick! Have a great day!

    Reply
  • You are a very capable person!

    Reply
  • Excellent weblog here! Also your website so much up very fast! What web host are you the use of? Can I am getting your affiliate hyperlink for your host? I want my web site loaded up as quickly as yours lol

    Reply
  • Good site! I truly love how it is easy on my eyes and the data are well written. I’m wondering how I might be notified whenever a new post has been made. I’ve subscribed to your feed which must do the trick! Have a great day!

    Reply
  • Great awesome issues here. I am very happy to look your post. Thanks so much and i am having a look forward to contact you. Will you please drop me a e-mail?

    Reply
  • I will right away grab your rss as I can’t find your e-mail subscription link or e-newsletter service. Do you have any? Kindly let me recognize in order that I could subscribe. Thanks.

    Reply
  • I would like to thank you for the efforts you have put in writing this site. I am hoping the same high-grade blog post from you in the upcoming as well. In fact your creative writing skills has encouraged me to get my own site now. Actually the blogging is spreading its wings fast. Your write up is a great example of it.

    Reply
  • Thanks for any other excellent article. Where else may anybody get that kind of information in such an ideal means of writing? I’ve a presentation next week, and I am on the search for such info.

    Reply
  • You made some decent points there. I looked on the internet for the topic and found most individuals will go along with with your blog.

    Reply
  • You made several nice points there. I did a search on the theme and found most people will go along with with your blog.

    Reply
  • I do not even know how I ended up here, but I thought this post was great. I do not know who you are but certainly you’re going to a famous blogger if you aren’t already 😉 Cheers!

    Reply
  • I keep listening to the news broadcast speak about receiving free online grant applications so I have been looking around for the best site to get one. Could you tell me please, where could i get some?

    Reply

Leave a Reply

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

%d bloggers like this: