How to Reduce WordPress Database Bloat

  1. What is Database bloat 01:12
  2. Better delete revisions 03:04
  3. Optimised Database 03:45
  4. lLomit the number of revisions 04:11

Read the full episode transcript below:

00:28 David Blackmon: Everybody welcome to another episode of WP The Podcast brought to you by WP Gears. I’m David Blackmon.

00:35 Tim Strifler: And I’m Tim Strifler. 

00:37 David Blackmon: Today in episode 635 we’re going to talk about how you can reduce WordPress database bloat. And this is important because speed matters! When it comes to not only your visitors but search engines algorithms place a high importance on how fast your website loads. And if you get your database bloated over time which it will that’s just how WordPress works you need to know how to clean it up. We’re gonna give you some tips and tools so Tim before we dive in why don’t you tell us what WordPress database bloat is? 

01:12 Tim Strifler: Yeah definitely. So WordPress basically it stores content inside of a mySQL database and so you basically have two parts to a WordPress website you have the files and then you have the content and the files is stored in a normal file structure and that’s your WordPress software itself. As well as your plugins and your themes and your your media uploads but everything else is stored in the database so content settings you know everything from like menus all the the the things that you’re doing within your theme or page builder all of those settings and stuff are stored in the in the database as well. So like really if you think about it everything you if you strip away the database you basically have an empty website. And so everything that you’re doing and changing and customizing and creating is stored in the database so it’s a huge huge portion of the site and so the longer your websites been around the more and more bloated the database can get. And so there’s a couple things
that will really blow your database. One of them being WordPress revisions and so I’m gonna let David talk about how to do this but basically Wordpres revisions when you make changes to a WordPress page or post or whatever. WordPress by default will store revisions and so it’s basically different versions of the page.So that you can go back and undo changes that you’ve previously saved and so it sounds like a great idea. The problem is is if your websites been around for a while and you made a lot of changes and you’re kind of designing and saving designing and saving well all the sudden before the site even goes live you have a huge bloated database of revisions and you have like 50 different versions of a page or post and so that’s a problem so yeah what do you do..

03:04 David Blackmon: Dang! Tim just stole my thunder! Man that’s the one that I could talk about it at length and the way that you handle that the easiest way to handle that is to use a plugin called Better Delete Revisions, and it’s a plugin that you can find in the WordPress repository and it’s awesome. And if you had to go in and manually delete these or even go in the database and delete them manually from the database as opposed to own your WordPress website will take a lot of time. And it would be really cumbersome. This thing allows you to do it automatically and stuff. You can there’s a lot of features and things that you can do to make that happen Tim what’s number two?

03:45 Tim Strifler: Yeah number two is Optimized Database after deleting revisions. And so this plugin it’s a separate plugin but it’s meant to be used with the plug and David just talked about and basically after you delete the revisions it will go and it will optimize your database. I’m not a mySQL expert so I’m not going to try to tell you what exactly it does to optimize but it’s something good to do and so we definitely recommend doing that. 

04:11 David Blackmon: The third thing that we recommend is to code snippet to limit the number of revisions. So I don’t know if we have
the code or not to give people Tim but it would be great if we could put this in our show notes. I’m pretty sure we could get it. If we don’t have it I could get Jonathan to give it to us, but you can put a piece of code in your website. Which is going to control the number of revisions that  WordPress is going to store in the database so yeah it’s pretty much that simple I can’t say anything more to it than that.

04:43 Tim Strifler: Yeah and I think there’s some might be a plugin as well but basically by limiting the number of revisions to maybe the
last five. You still have that fallback in case you need to you know revert back to a previous version without getting a huge database. So it’s like an WP Engine actually they’re hosting when you have a website with a VP engine revisions don’t work at all however there’s times where I really
wish that it did work and so having kind of something in-between a ton of revisions and no revisions you know is the ideal situation in my opinion. So yeah we’ll see if we can get again I found a blog post here we’ll put in the show notes on how to limit revisions and the next thing here is kind of separate but similar and that is to actually go. The next thing here is kind of separate but similar and that is to actually go plugins and so for example if you’re kind of in a design development phase of a WordPress website you’re probably installing different plugins and sometimes it might not do what you want you deactivate and find a similar one or you know or maybe you’re using something for a while and then you deactivate and decide you don’t want anymore. Well depending on the plug-in there’s typically going to be some sort of content that’s saved in the database whether it’s settings whether it’s actual like content itself like custom post type content there’s gonna be something that’s saved in there and if you go and later reactivate that plug-in you’re gonna any changes that you made previously are gonna be there. As if you never deactivated it which is a nice feature to have. So that if you change your mind and come back to it everything is saved nicely where you left it. However it’s also going to bloat your database if that happens with a lot of different plugins and you plugins you’re never going to come back – you don’t really need it to save its data and so some plugins very few will give you a way to remove the data after deactivating it and it’s usually an additional setting you have to turn on to remove the data. But most plugins don’t have that and so the way you do that is from your server there’s a server tool for my sequel database is called PHP My Admin. And it basically lets you see all of your database tables and rows and
and all of that and so you can basically find the different plugins that are on there and you can actually remove those tables or rows or whatever or entire databases, depending on the plugin. And that can can reduce database bloat. Now I will say this this is some advanced stuff here and you absolutely want to make sure that you have a current backup before you do this because if you remove the wrong thing you can completely just break your site into oblivion and so you want to make sure you have a backup you want to be careful but this can be a helpful way of kind of slimming down that database.

07:40 David Blackmon: Fantastic! Well there you go folks how to reduce WordPress database bloat and why it’s important that you take care of it. Tomorrow we’ve got another great episode five ways to increase your website traffic this month Tim until tomorrow we’ll see you then.

07:53 Tim Strifler: Take care bye bye.

Did you Enjoy this Episode?

  • Will you consider sharing it online? Just click one of the share buttons below!
  • Will you leave us a review? 🙂
  • Have a question, or a topic request? Let us know in the comments below!

Want to Connect with David & Tim?

Submit a Comment

Your email address will not be published.

Where To Find Us

Listen to WP The Podcast on your favorite platform: