From the course: WordPress: WP-CLI

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Maintaining the database

Maintaining the database - WordPress Tutorial

From the course: WordPress: WP-CLI

Start my 1-month free trial

Maintaining the database

- [Instructor] WP DB offers several commands to get info about the database, as well as ways to clean up and optimize the database. Good database maintenance can have a big impact on the performance of your website. Here's a look at commands like optimize, repair, and clean. First up is db optimize which runs the optimize table statement. According to the MySQL documentation, optimize table reorganizes the physical storage of table data and associated index data to reduce storage space and improve I/O efficiency while accessing the table. The exact changes made to each table depend on the storage engine used by the table. This basically cleans up how your database is organized so MySQL can find data more efficiently. It's almost like cleaning your desk or reorganizing your file cabinet. To do this on your WordPress site, you can run wp db optimize. The optimize table command will go through a number of commands for each…

Contents