Session Overview

Sam wanted to clean up Simple History data that he believed was bloating the WordPress database on aguiarinjurylawyers.com. He had just upgraded from Simple History (free, v5.26.0) to Simple History Premium (v1.12.0) about 5 minutes before the session started, and wanted to set up the Premium "External Database Channel" feature to store logs in a separate MySQL database going forward.

During the investigation, it turned out Simple History was NOT the source of any bloat. The Premium upgrade had created fresh tables with only 12 rows. The actual database bloat came from three other sources: orphaned staging tables from a defunct staging site (es.aguiarinjurylawyers.com), RankMath hoarding Google Search Console analytics data, and a bloated wp_options table.

The session pivoted to a full database cleanup. The Simple History Premium external DB channel setup was deferred to a follow-up session.

What Was Accomplished

Database Audit

SSH connection to Cloudways (port 2217, user admin) confirmed the WordPress installation lives at /var/www/html/public_html. The database is application21392 on MariaDB. WP-CLI is available at that path.

Starting state: 604 MB across 146 tables. Uploads folder: 935 MB (normal, not a concern).

1. Dropped 54 Orphaned Staging Tables (289 MB reclaimed)

The esweb_ prefix tables were from a Cloudways staging clone of the production site (es.aguiarinjurylawyers.com). Sam confirmed the staging site is no longer in use. All 54 tables shared the production database (application21392); there was only one database on the server.

Before dropping, a full SQL backup was exported:

All 54 tables were dropped via a single DROP TABLE command through WP-CLI. Verified: 0 esweb tables remaining after drop.

2. Truncated RankMath GSC Analytics Table (131 MB reclaimed)

The wp_rank_math_analytics_gsc table had 457,227 rows spanning August 21, 2025 through March 2, 2026. This data is all available directly in Google Search Console, so local storage is redundant.

Truncated tables: