How To Reduce WordPress Database Size Like A Pro
Reduce and Optimize WordPress Database Size: Blog loading time is one of the most important search ranking signals used by the search engines. A faster website helps search engine crawlers to access your web pages quickly and easily. No one likes a slow site, a faster website also provides better user experience.
Many shells out their money on coding or clutter-free designs to reduce their site loading time.
But simply reducing the WordPress database size can significantly reduce the loading time of your site and makes it faster. Actually, when you install WordPress then WordPress files and WordPress database is stored on the server.
And as you use WordPress, your database accumulates a lot of extra data like spam comments, trash comments, post revisions etc. that increase the database size. Thus, this leads to increase in blog/site loading time.
So it is necessary to clean up WordPress database at regular intervals to reduce database size. Removing extra data such as revisions, spam comments, unused records will not affect your website. Cleaning up database will reduce the load on your server and your WordPress performance will certainly improve.
In this article, I will be discussing how to clean up WordPress database and reduce the size of your database significantly.
But before you proceed, I recommend you to create a backup of your website and database. You can check the list of best backup plugins for creating WordPress backup.
How To Clean Up and Reduce Database Size To Optimize Database
1. Backup Your WordPress Database
Before you do anything with your WordPress database, you must take backup your database. You can use WP DBManager WordPress plugin for creating database backup easily with a single click. Simply install and activate the plugin and go to Database >> Backup DB. This is the most important step before doing anything else. Database backup is highly recommended.
2. Deactivate & Delete Unwanted WordPress Plugins
First of all, go through your installed WordPress plugin list. Deactivate and delete unwanted WordPress plugins. You should first deactivate and then completely delete the plugins that you are not using anymore. This would help us to delete unwanted tables created by these unused plugins.
3. Clean Orphan Tables
You can use Clean options WordPress plugin and follow these instructions to find and clean Orphan and unused tables in your database. You have to deal with this critical step with utmost care. If you are not sure you can skip this step and move on to other steps.
4. Delete Spam Comments, Trash Posts And Post Revisions
5. Use MySQL Queries For Optimizing Database
Most of us use Akismet WordPress plugin to fight spam. But Akismet is also responsible for increased database size due to one of its table wp_commentmeta. Assuming you have installed and activated WP DBManager as mentioned above, run MySQL queries from WordPress dashboard by simply going to Database >> Run SQL Query. Run these queries one by one.[css]DELETE FROM wp_commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM wp_comments);[/css] [css]DELETE FROM wp_commentmeta WHERE meta_key LIKE ‘%akismet%’;[/css]
Note: Don’t forget to check table name before running these MySQL queries. Following are few more MySQL queries that will help you in further reducing your WordPress database size.[css]DELETE FROM wp_postmeta WHERE meta_key = "_edit_lock";[/css] [css]DELETE FROM wp_postmeta WHERE meta_key = "_edit_last";[/css]
6. Empty/Drop Unused Database Table
Skip this step if you are not sure what you are doing. Empty/Drop tables are created by those plugins which you have uninstalled or deleted. If you have WP DBManager plugin installed, simply go to Database >> Empty/Drop Tables and select and delete the table created by the plugin that you do not use anymore.
7. Optimize WordPress Database
At last, you should optimize your WordPress database. Actually, every information is stored in the database. So, if you are having a un-optimized database, then every time when page loads, it takes a longer time to find and display information.
You can use WP DBManager WordPress plugin to optimize your database and see how much database size you have reduced. Assuming you have this plugin installed, just go to Database >> Optimize DB.
BONUS TIP: Use a Cache Plugin
Actually, caching plugins create a static version of your website pages and generate that page for a first-time visitor by accessing database and stores it on the server. So when the visitor again visits the page, then the same page is pre-generated thus database is not accessed this time.
That's all. Follow these steps and this will surely reduce and optimize your WordPress database and thus speed up your blog. You should clean and optimize your WordPress database once every two weeks. For any feedback as well as query, please leave a comment.