WordPress database optimization can help optimize page load time for your website. WordPress database bloat or in simple terms, unnecessary plugins & files, can cause some unwanted slow load times on your website.
They say acceptance is the first step on the road to recovery. So my name is Lance Dockins and I am a digital hoarder.
Basically, that just means that I’m convinced that I might someday need the crap I haven’t even thought about in 5 years. That’s especially true for things that I don’t feel like I fully understand.
And having been on a number of WordPress websites, I’m convinced that most website owners suffer from the same disease. That would at least explain the sheer amount of garbage we typically find on the average website.
Common WordPress Database Optimization Opportunities
After several WordPress optimization projects, there are some recurring opportunities to improve page load times. To name a few of the more common hoarder piles:
- Active plugins (or hell… even inactive plugins for that matter) that haven’t been used in ages
- Ditto that with themes
- Revisions of every post you have made back to the beginning of time
- Old caching garbage – especially with certain themes (cough… Headway)
- Records of online orders from orders placed years ago
- Pending comments
- User accounts for people that only ever needed to log into the site one time
- Features inside of any part of WordPress that are enabled but not being used
Fortunately, of all of the different things that can cause slowdowns, these are the easiest to solve. Just clean house.
Disclaimer: Before you go deleting everything in sight, take a backup first. Nothing sucks worse than deleting something you didn’t think you needed only to find that you’re site is completely hosed afterward. And as always, if you’re not absolutely certain about what you’re doing, bring in a pro.
How do I optimize my WordPress Database? 7 Easy Optimization Tips
- If you’re not using it, disable it. Those active plugins and features (or plugin settings) in your site that you always planned to use but never acted on are only causing WordPress to do extra work that it doesn’t need to be doing. Shut them off if you don’t need them. Less to manage = less horsepower wasted.
- If you don’t need it, don’t keep it. Period. Even if it’s inactive, your best case scenario is that it doesn’t slow down your site or threaten its security. And you probably aren’t living that best case scenario.
- Limit post revisions. By default, WordPress creates a new revision every time you hit the Update button. The more you edit a page, the more copies of it you have on file. Individually it’s no big deal. But with a giant pile of them, WordPress basically has to find a needle in a needle stack every time it loads one of your pages. Edit your wp-config.php file and pick a comfortable number of revisions to keep around. How many is up to you, but for most sites, 3-5 revisions are more than enough and when it comes to speed, less is more.
- Clear the database garbage (comments, expired transients, etc). There are a variety of plugins that can help with this. My favorite is WP Optimize. Just be careful with any database cleaning plugin that you decide to use. If you’re not absolutely certain what you’re deleting, don’t delete it. If you’re not absolutely certain what the plugin is going to do, don’t use it.
- Disable features you don’t need. Not planning to use comments on the site at all? Globally disable them with the Disable Comments plugin. Skipping out on product reviews or ratings on reviews for your e-commerce shop? Disable WooCommerce’s reviews or ratings on reviews.
- Archive or delete old orders. Right now this is a bit of a manual process but if you’re running an e-commerce site and you don’t need old order data around in your site, make sure you have copies of all of the customer and order data that you do need and then delete the old orders that you don’t need.
- Trim your image sizes. It’s typically best to upload images that are already prepped for web use so that they aren’t gigantic going in, but if you already have a media library full of big images, you can use an image optimizer plugin like WP Smush to start sizing things down. If you have a ginormous media library, though, even that takes forever so you might want to consider downloading all of the images over FTP, using a batch image optimization tool like Adobe Photoshop if you have a huge media library and re-uploading them via FTP. Having a fast computer (with an SSD) and a high-speed internet connection helps speed this along. Again, just make sure you know what you’re doing if you go this route.
Once you’ve flushed the garbage, you should notice an uptick in speed, but your mileage will absolutely vary based on the size of the problem you start with and the rest of the configuration behind your site. This leads to the next major cause of slowdowns – forcing square pegs into round holes.