Skip to content

Optimize WordPress databases

  1. Choose the intended servers and sites. Start with one installation.
  2. Keep a usable database backup and choose a period with spare host capacity before opening the action.
  3. Open Choose action → Bulk tools → Database → Optimize databases.

Bulk tools search showing Optimize databases in the Database group

Choose Optimize databases only after preserving a backup and selecting the intended sites. Inspect its final output after confirmation. Select the image to view it full size; use your browser’s Back command to return.
  1. Review the action and targets, then confirm. Read every site’s final result, including skips. Finished can include failed sites; see Read the outcome.

Inspect each table/site result and resolve reported failures separately. Optimization does not scan for malware or prove faster application performance.

For recurring optimization, review Database optimization in this server’s WordPress Settings. It runs during eligible AutoShield work; choose it only when that database work is intended.

WordPress Settings showing Database optimization separately from Database malware scan

Choose recurring optimization separately from scanning. The image shows a saved configuration, not a completed optimization. Select the image to view it full size; use your browser’s Back command to return.

From a root terminal on the server hosting the sites, run:

Terminal window
cpfence --bulk-optimize-wp-databases

Review /var/log/cpfenceav/wp-sites-list.txt and the inventory confirmation first. This uses the server’s listed installations, not checked WebUI rows. Keep a usable database backup and choose a quiet period with spare capacity.

Inspect each site’s table results and any errors before retrying only the affected sites. If cached pages need refreshing afterward, clear LiteSpeed Cache separately. For a daily check, use the Database optimization policy above; immediate optimization does not enable that schedule.