Tech

How to Reduce the Database Size in WordPress

Reduce the Database Size in WordPress

Wondering how to reduce the Databse size in WordPress? If your answer is yes then I am here to help you out.

Well, if you are using WordPress for a while, then it is extremely important for you to clean up your site on a regular basis. By doing regular cleanups you will be able to reduce your database size and actually speed it up. As a result, your website will perform much better and offer you a greater experience that all visitors will know how to appreaciate.

But not all of us are really aware of how to reduce the DB size in WordPress, so if you are one of those, then you better stick with this article as I will be explaining how to reduce the DB size in WP. So let’s just head into the job without wasting much of the time:

How to reduce the DB size in WP?

Backup Your Website:

Before digging deeper, here is a friendly advice. Do take a backup of your WordPress website. While making changes you might end up ruining your website. And to roll back to the old state, you will need a backup. So you better make a better at the first step only.

Deactivate Unwanted Plugins:

If you look into your installed plugins page, you will find that there are quite a lot of plugins that you do not use. And by keeping them you are only increasing the database size. So you better delete all the unwanted plugins for your WordPress website.

Delete Spam Comments, Trash Posts, And Post Revisions:

After that focus on deleting all the spam comments, trash posts and post revisions data. However, cleaning them manually can be a tough job to do. But the good part is there are quite a lot of plugins are available which makes it easy. For example, you can try out plugins like WP-Sweep or WP-Optimize for the job. They are free to use and works in an awesome way.

Use MySQL Queries For Optimizing Database:

Next, you can use MySQL queries to optimize the database. Most of us use the Akismet plugin on our WordPress website to fight against spam. However, Akismet often increases the database size of our website. So it’s better to clean up that garbage. In order to do so, you have to install the WP DBManager plugin. Then you have to run MySQL queries from WordPress dashboard by simply going to Database >> Run SQL Query.

After that, you have to run these queries one by one:

DELETE FROM wp_commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM wp_comments);

DELETE FROM wp_commentmeta WHERE meta_key LIKE ‘%akismet%’;

DELETE FROM wp_postmeta WHERE meta_key = “_edit_lock”;

DELETE FROM wp_postmeta WHERE meta_key = “_edit_last”;

Empty or Drop Unused Database Table

If you look into your database, then you will figure out that there are quite a lot of empty tables exists. These tables are created by those plugins which you have uninstalled. So in case if you don’t use those plugins, then you can delete their tables to reduce the DB size. To do so, you can simply use the WP DBManager plugin. After that go to Database,>> Empty/Drop Tables and select and delete the table created by the plugin that you do not use anymore.

Optimize WordPress Database

In the end, you have to optimize WordPress database. This contains all the data that is stored in your website’s database. So if you have an unoptimized database. Then it can affect your website’s performance. That is why you better optimize your WordPress database. To do so, you can use WP DBManager WordPress plugin to optimize your database and see how things are going for you.

Reduce the Database Size in WordPress

So that were all the steps that you have to follow to reduce the DB size in WP. Apart from these steps if you feel like editing your .htacess file, you can also do so in the easiest way. All you have to do is install the wphtaccess and it will allow you to edit your .htaccess file from the WordPress dashboard only.

Moreover, you can also go ahead and reset the WordPress database. Although, this will completely wipe out all your WordPress site data. But if you feel a need of doing so. Then you can try out the WP Reset Plugin. It’s free to use and makes the resetting database process easier.

Anyway, in the end if you have any more questions to ask feel free to comment below and I will surely help you out.

If you liked how WP Reset works, you should also check other plugins from the same developer like UnderConstructionPage, Google Maps Widget, Coming Soon & Maintenance Mode as well as Security Ninja.

About the author

Olivia Wilson

Olivia Wilson is a digital nomad and founder of Todays Past. She travels the world while freelancing & blogging. She has over 5 years of experience in the field with multiple awards. She enjoys pie, as should all right-thinking people.

Add Comment

Click here to post a comment