It is always good practice to optimize your blog’s database to improve blog’s performance. Many are not aware about WordPress’s built-in database repair and optimize functionality, as it is not available in admin back-end.
You can check this by visiting http://yourdomain.com/wp-admin/maint/repair.php (replace http://yourdomain.com/ with your actual blog/site url ).
Below is a step by step guide on how to optimize WordPress database :
- First login to admin section of WordPress blog by visiting http://yourdomain.com/wp-login.php .
- Then go to http://yourdomain.com/wp-admin/maint/repair.php .You can see screen as show below. It ask you to add a line of code to WordPress’s wp-config.php file.
- Add below code to your WordPress wp-config.php file and reload/refresh page.
- After refreshing you can see page with options to ‘Repair Database’ and to ‘Repair and Optimize Database’. Just click on one of the option.
- If you click on ‘Repair Database’ button, WordPress can automatically look for some common database problems and repair them. Internally it executes two sql queries on each WordPress database tables in loop and these queries are CHECK TABLE table_name and REPAIR TABLE table_name .
- If you click on ‘Repair and Optimize Database’ button, WordPress can also attempt to optimize the database. This improves performance in some situations. Repairing and optimizing the database can take a long time and the database will be locked while optimizing. Internally it executes four sql queries along with above two queries on each WordPress database tables in loop and other two queries are ANALYZE TABLE table_name and OPTIMIZE TABLE table_name .
Hope this will improve your WordPress blog’s performance. Drop in your comments!
(P.S. : Please take backup of your WordPress database before making any action on database)