Speed and performance – these are the key principles on which websites are always judged. While what you put on your site matters too, it’s more subjective. Speed and performance are a little more universal.

WordPress is a powerful platform but if you neglect the database that underpins your WordPress site, that speed and performance can take a hit.

The importance of WordPress database optimisation

An optimised database enhances your website’s loading times as data can be retrieved much faster. The faster pages load, the better the user experience and the more likely your site is to rank higher.

A streamlined database also uses fewer server resources, which could save serious costs in a shared hosting environment​. So, it’s a win-win, but it’s also something that might seem intimidating on the surface. Thankfully, it can be simplified using a third-party plugin

Before we start spring cleaning though, let’s explore some more common culprits of database bloat, besides stuffing your site with too many plugins.

Common culprits of database bloat

Every action you and your users take is stored in your database. This includes all post revisions and comments, including spam. Inevitably, that’s going to include a lot of unnecessary and unwanted data that could seriously clutter up your database. 

Common causes of database bloat include:

Post revisions

WordPress records every revision and draft you make to every post. Over time, these can add up to a significant number, especially on sites with frequent updates. By default, WordPress also autosaves posts every 60 seconds with a chronological record of all edits. More often than not, this is hidden data you wouldn’t want anyone to see anyway.

Spam comments

Comments marked as spam will remain in your database unless you manually remove them. This is even true if you have an effective anti-spam plugin installed. If you’ve been the victim of a prolific spammer, these comments will not only slow your site down but could pose a serious security risk.


Just because you’ve deleted a post, page or comment, that doesn’t mean it’s automatically gone forever. All site content is retained in your trash folder for 30 days by default, during which time they continue to occupy space.

Expired transients

These are temporary data caches used by developers to speed up operations in the short term. WordPress doesn’t remove them automatically, even when they’re no longer required, leading to additional bloat.

Unused tables

By default, WordPress data is stored in 12 core tables (options, posts, users, etc.) each storing a specific type of data. If a plugin you’re using creates its own table and you later delete that plugin, the table and all the data within it will remain. If you’re always experimenting with different plugins, this could become a major bloat issue.

Orphaned metadata

When you delete a plugin or theme, it may also leave behind metadata, further cluttering the database​.

Why Pre-Optimisation Backups Are Crucial

While it’s unlikely you’ll erase any important information, it’s not impossible. That’s why, before optimising your WordPress database, it’s essential to perform a backup of your site. Think of it as a safety net, allowing you to restore your website to its original state should anything go wrong during the optimisation process.

There are many user-friendly backup and restoration tools and plugins available for WordPress. This ensures that even those with minimal technical expertise can secure their data efficiently. Indeed, many plugins even create regularly scheduled automatic backups. So, you don’t even need to think about it!

If you’re feeling nervous about it, you might also want to consider testing the optimisation plugin on a staging or development site first. This will allow you to identify any issues before applying changes to your live site.

Optimising your WordPress database

It’s possible to manually optimise your database, and some power users may prefer the flexibility this option offers. However, WordPress comes with a built-in database optimisation tool. It can still be quite complicated for some users though. For most users, we’d always recommend using a WordPress database optimisation plugin. These plugins will not only leave you with a compressed and clear WordPress database but will also backup and restore files.

Whichever method you choose, however, WordPress database optimisation is more than a preventative measure. It’s an essential proactive strategy for all WordPress users. By addressing database bloat, you can maximise the potential of your online presence. 

After optimizing your database, it’s crucial to carry out routine maintenance tasks on your WordPress site to sustain its performance over time.


Will WordPress database optimisation cause irreparable data loss?

It’s unlikely you’ll lose any important data during database optimisation. However, you should always perform a full site backup beforehand to be safe.

What is MySQL?

It’s the most popular open source database in the world, used by WordPress, Facebook, Netflix, Airbnb and thousands more.

Why is my WordPress site so slow?

There are several reasons why your site may be underperforming. You might have too many plugins, a limited hosting plan or you may be suffering with database bloat. The latter can be resolved through database optimisation.

How do I access my WordPress database?

This will depend on your host. In most cases, however, as WordPress is open source, you should be able to access your database via an admin tool.

Do I need to edit my WordPress database?

You don’t need to interact with the database to publish or edit your site but if it’s suffering from poor performance, you might need to give it a clean up. 

Why should I optimise my WordPress database?

Primarily, it will enhance site speed, performance and stability. This may in turn improve the user experience and help your site rank higher in search.

What are the benefits of manual WordPress database optimisation over using a plugin?

Manual optimisation lets you fine-tune aspects of your database. As you’re fine-tuning the data yourself, you naturally have more control over what is being deleted, refined or tweaked.

Clear out your database

As well as compress images, cache, and minify your WordPress website. Get a faster site with WP-Optimize.

Boost my site