MySQL has an OPTIMIZE TABLE command which can be used to reclaim unused space in a MySQL install. You can think of this kind of like defragging your hard drive. The Perfmatters table optimization feature runs the OPTIMIZE command on any tables in your WordPress site’s database that can be optimized.
Note: The OPTIMIZE command doesn’t run on InnoDB tables, as this isn’t needed and in fact can cause problems, such as rebuilding the entire table. This feature is primarily used for MyISAM tables. Some managed WordPress hosting providers, like Kinsta, convert your tables to InnoDB when you migrate over. This is for better performance. So this optimization feature is really suited for those running on shared hosts and with the older storage engine.
Optimize WordPress database tables
Follow the steps below on how to optimize your WordPress database tables.
Important: These functions make permanent changes that cannot be reverted! Back up your database before proceeding.
Click into the Perfmatters plugin settings.
Click into the “Tools” page.
Click on the “Database” tab.
Scroll down and toggle on “Tables.” The number of unoptimized tables found will show up to the right of it.
Scroll down and click “Optimize Now.”
The process will run in the background. You don’t need to stay in the plugin while it’s running or worry about leaving the window open.
It will let you when it’s finished with a notification at the top of the Perfmatters plugin settings.
Check out our documentation on WordPress database optimization for other easy ways to clean up your database with Perfmatters. You can also optimize your database tables on an automated schedule.