Tutorial on How to Optimize and Clean Up Your WordPress Database. Many bloggers think optimizing database is a difficult task and need some expertise, but in fact all those assumptions are wrong. By the time you finish reading this article, you will be confident enough to optimize WordPress database of your blog. Now, lets move-on to the topic.
img via
Reasons to Optimize WordPress Database
Here are some reasons on “Why to optimize WordPress Database ?”
- Optimization helps to reduce the size of database.
- After optimizing, the loading speed of your blog increases.
- Improves search engine rankings due to better user-experience.
How to Optimize and Clean Up Your WordPress Database
Before starting with the process it is always recommended to back up your WordPress database. You can also learn How to Backup your WordPress Blog to Google Drive.
1. Optimize and Repair WordPress Database using WP-Config
WordPress got an inbuilt feature that helps to repair and optimize Database easily. Follow this simple tutorial and optimize your database using wpconfig.php file.
- Login to your WordPress blog and open the link posted below.
http://YOURBLOG.COM/wp-admin/maint/repair.php
Replace YOURBLOG.COM with your blog link.
- It will ask to add a piece of code to
wp-config.phpfile.

- Here is the code you need to add to
wp-config.phpfile.
define(‘WP_ALLOW_REPAIR’, true);
- After adding the code refresh the page and it will look like this.

- Now, two buttons “Repair Database”, “Repair and Optimize Database” will be displayed and here is the detailed functionality of both of them.
Repair Database Button
WordPress will look for common database problems and will repair them automatically. It executes these two sql queries internally.
CHECK TABLE table_name
REPAIR TABLE table_name
Repair and Optimize Database Button
Along with the repair, WordPress tries to optimize the database for improved performance and during this time your database will be locked till the process is finished. It executes these four sql queries internally.
CHECK TABLE table_name
REPAIR TABLE table_name
ANALYZE TABLE table_name
OPTIMIZE TABLE table_name
That’s it, you have successfully optimized your database using WordPress functionality. As there is chance for unauthorized persons to optimize your database, it is recommended to remove define('WP_ALLOW_REPAIR', true); code from wp-config.php file.
2. Optimize WordPress Database using Plugins
Here are 2 awesome plugins that help to Optimize your wordPress database easily. Simply install any of these plugins and optimize database with single click of mouse.
WP-Optimize
WP-Optimize is a great plugin used my many WordPress bloggers. It not only helps to optimize your database, but also helps to cleanup your database tables and saves you some space.
Features of WP-Optimize
Here are some notable features of WP-Optimize plugin
- Removes all Post revisions
- Removes auto drafted posts
- Cleans Up spam comments
- Removes unapproved comments

How to use WP-Optimize Plugin
- Download and install WP-Optimize plugin using this link below.
- Go to WP-Optimize Admin Panel and select the check-boxes.
- Click on Process button and everything will be cleaned automatically.

If you are not satisfied with WP-Optimize plugin, then here is another plugin to get your job done.
WP Database Optimizer
This is another useful plugin to optimize database automatically based on a schedule. If you have experimented with plugins and deleted many posts in your blog, then this plugin helps to clean up your database.
Features of WP Database Optimizer
- Optimize database based on a schedule
- “Optimize Now” button to process instantly.
- All tables and Overhead will be displayed.

How to use WP Database Optimizer Plugin
- Download and install WP Database Optimizer plugin using the link below.
WP Database Optimizer Plugin »
- Go to plugin options panel and set the frequency.
- Click on “Optimize Now” button to finish the process.
You have successfully optimized WordPress database using plugins. If you got any query regarding this article or if you know any other plugin to optimize WP database, then please do let us know by dropping a comment.


How to Login to WordPress using Email Address
Alternatives to WP Smush.it WordPress Plugin
How to Add FeedBurner Optin form to WordPress Blog
How to add ALT tag to images in WordPress
How to Add 3 Column Widgetized Footer to Genesis
thanks a lot. i need optime wordpress database
Nice tips.I try to implement for my wordpress blog.Thanks for the informative post.
thanks for the helpful post.But i want to ask a question,which one you suggest? wp-cleanfix or wp-optimize for database optimization?