OG Database Cleaner¶
OG Database Cleaner finds the clutter that builds up in a WordPress database and lets you remove it. It cleans revisions, trash, spam, transients and leftover metadata, and it optimises and repairs tables. Big jobs run in small batches, so large sites avoid timeouts.
Who it is for: site owners, agencies and developers who want a smaller, faster database, from small blogs to large WooCommerce shops.
Building on it? See the developer's guide.
Back up first
Database Cleaner deletes permanently. There is no trash and no undo. Take a full database backup before you clean anything, and check that you can restore it.
Lite and the full version¶
There are two editions. Both use the same settings, so moving from Lite to the full version keeps them.
| Lite (free) | Full version (paid) | |
|---|---|---|
| Get it | OG Database Cleaner Lite | OG Database Cleaner |
| Licence key | None | One key per site, yearly or lifetime |
| WordPress core clean-ups (revisions, drafts, trash, metadata, comments, transients) | Yes, by hand, one item at a time | Yes, by hand or with Auto Clean |
| Easy and Expert modes | Yes | Yes |
| Post Types, Options, Cron | Yes (list shows All only on Options and Cron) | Yes, with Used, Not Used, Unknown and Autoloaded filters |
| Tables | Optimise or repair one table at a time | Optimise, repair or remove, one at a time or in bulk |
| Metadata browser | No | Yes |
| Custom Queries | No | Yes |
| Jellybean Sweeper (scheduled auto-clean) | No | Yes |
| Deep Deletions | No | Yes |
| Delete Protected Items | No (always protected) | Optional switch |
| Assign "Used by" owners | No (the Used By column is read-only) | Yes |
| MCP tools for AI assistants | No | Yes, with OG AI Core |
| Database size history and logs | Yes | Yes |
| Calls to OG Nexus | None | Licence and updates only |
If both editions are installed, the Lite stands down and shows a notice. You can then delete the Lite.
Install and activate¶
- Install and activate the plugin. The steps are in Install and activate.
- Open OG Nexus › Database Cleaner in the admin menu.
Lite: there is no key to enter. The License tab only tells you what the full version adds.
Full version:
- On the Plugins screen, click Enter Pro licence key under OG Database Cleaner. The notice on the plugin's own screens has the same link.
- Paste your key from My Account › Licences on og-nexus.com into Licence key.
- Click Save licence. The status changes to Pro, licensed.
After the licence is accepted, the Pro features are installed from og-nexus.com. They are installed again straight after each update. Until then you see Licensed, Pro features not installed yet and only the free features run. Click Install the Pro features now in the notice to try again.
To move a licence, click Remove licence from this site. The free features keep running. See Licences and tiers for what each tier allows.
How the screen works¶
Everything happens on one screen with tabs. The first tab is WordPress Core.
Easy and Expert mode¶
Use the Easy / Expert mode switch.
- Easy shows WordPress Core, Tables, Settings & Logs and License.
- Expert adds Post Types, Options and Cron. In the full version it also adds Metadata and Custom Queries (when their modules are on).
Colours and protection¶
Each list shows who uses an item (Used By) and a status:
| Status | Meaning |
|---|---|
| Used | The owner (WordPress, a plugin or a theme) is installed and active. |
| Not Used | The owner is known but no longer installed. This is likely a leftover. |
| Unknown | Database Cleaner does not know the owner. Unknown does not mean unused. |
Items used by WordPress itself have blue buttons and are protected. You cannot delete them unless you switch on Protected Items › Enable Deletion (full version only). Tick Hide items used by WordPress to hide them from the lists.
Tabs¶
WordPress Core¶
The clean-ups every site needs, in five groups:
| Group | Items |
|---|---|
| Posts | Revisions, Auto Drafts, Deleted Posts |
| Post metadata | Orphaned Post Meta, Orphaned Term Meta, Orphaned Term Relationship, oEmbed Caches, Unused Terms, Duplicated Term Meta, Duplicated Post Meta |
| Users | Orphaned Meta, Duplicated Meta |
| Comments | Spam, Deleted, Unapproved, Orphaned Meta, Duplicated Meta, Pingbacks |
| Transients | Expired Transients, All Transients |
Each item shows a Count. Click its refresh icon to count it, and its bin icon to clean it. Only entries older than the Age Threshold are counted and cleaned.
In Expert mode each item has a Mode:
| Mode | What it means |
|---|---|
| Auto | Cleaned by Auto Clean and the Jellybean Sweeper (full version). |
| Manual | Only cleaned when you click its bin icon. |
| Never | Never cleaned. |
Duplicated meta items are Manual by default. Duplicates are better checked by hand.
In the Lite, the Mode is Manual or Never only, and there is no Auto Clean button.
Post Types¶
Lists every post type in the database with its count, owner and status. You can empty a post type that a removed plugin left behind. WordPress's own post types (posts, pages, attachments, revisions and so on) are set to Never.
Tables¶
Lists every table with its Size, Relative %, owner and status.
- Optimize reclaims space freed by past deletions. It locks the table while it runs, so avoid peak hours.
- Repair fixes a damaged table.
- Remove drops the table and all its data (full version only). WordPress core tables are always refused.
The full version can select several tables and optimise, repair or remove them together. The Lite works one table at a time.
Options¶
Lists the rows in the options table (transients are left out, because they are cleaned under WordPress Core). Each row shows its size and whether it is autoloaded.
- Switch Auto off to stop a large option loading on every page. This is safe and you can switch it back.
- Delete an option a removed plugin left behind.
Cron¶
Lists the scheduled jobs with their Schedule, Next Run and owner. A job whose owner is gone will never run, so it is safe to remove. A job from an active plugin comes back on the next page load, so removing it does nothing.
Metadata (full version)¶
Lists post meta and user meta rows, biggest first, with the owner of each meta key. Use it to find which keys take up the space.
Custom Queries (full version)¶
Save your own SQL: a count query and a delete query. Run Count shows how many rows match. Run Delete runs the delete query. Only administrators can add, change or run custom queries.
Warning
Custom queries run exactly as written. Test the count query first, and keep a backup.
Settings & Logs¶
| Setting | What it does | Default |
|---|---|---|
| Age Threshold | Only items older than this are counted and cleaned. Choose 1 day, 7 days, 14 days, 1 month, 3 months, 6 months or 1 year. | 7 days |
| Message | Hides the introduction text once you have read it. | Shown |
| Batch Size | The most entries deleted in one request. Lower it on a huge database. | 100 |
| Delay (in ms) | Pause between batches. | 100 |
| Build Indexes / Remove Indexes | Adds an index to the post meta table so the Duplicated Post Meta count runs faster, or removes it again. | Not built |
| Deep Deletions (full version) | Deletes through WordPress's own functions, as if you deleted each item yourself. Slower, but related data is cleaned too. | Off |
| Custom Used By data (full version) | Reset Used By clears the owners you assigned by hand. | |
| Jellybean Sweeper (full version) | Enable Scheduled Auto-Clean runs Auto Clean on a Schedule: every 5, 10 or 30 minutes, hourly, twice daily or daily. Stuck Reset stops and resets a run that takes longer than this many hours. Perform Next Task and Reset Tasks run or reset it by hand. | Off, hourly, 10 hours |
| Modules (full version) | Switch the Post Types, Tables, Options, Metadata, Cron and Custom Queries tabs on or off. | On |
| Auto-Refresh Counts (full version) | Counts everything when you open the plugin. Leave it off on a very large database. | Off |
| Protected Items › Enable Deletion (full version) | Lets you delete items used by WordPress or plugins. | Off |
| MCP (full version) | Adds the Database Cleaner tools to the MCP server of OG AI Core. Needs OG AI Core with its MCP module on. | Off |
| Dev Tools (full version) | Adds a tab with debugging tools. For developers only. | Off |
| Developer options (full version) | Reset Options puts every setting back to its default. |
Logs lists what was cleaned and the database size checks. Use Refresh Logs and Clear Logs. Historical DB Sizes shows how the database size changed over time.
License¶
- Lite: what the full version adds, with links to og-nexus.com, the product page and the guide.
- Full version: your licence status.
Common tasks¶
Clean old revisions¶
- Take a database backup.
- Open OG Nexus › Database Cleaner › WordPress Core.
- Under Posts, click the refresh icon next to Revisions.
- Click the bin icon and confirm.
Clean everything set to Auto (full version)¶
- Take a database backup.
- Check the Age Threshold under Settings & Logs.
- On WordPress Core, click Auto Clean.
- Wait until the clean-up finishes. Leave the page open while it runs.
Clean the database every night (full version)¶
- Open Settings & Logs.
- Switch on Jellybean Sweeper › Enable Scheduled Auto-Clean.
- Set Schedule to Daily.
- Set each item's Mode to Auto or Manual on WordPress Core.
Stop a large option loading on every page¶
- Switch to Expert mode.
- Open Options and sort by size.
- Switch Auto off for the large option.
Find tables left by removed plugins¶
- Switch to Expert mode and open Tables.
- In the full version, filter by Not Used.
- Check what a table holds before you remove it.
FAQ and troubleshooting¶
Is it safe? Items WordPress relies on are protected, and every deletion asks you to confirm. Deletions are still permanent. Always keep a backup.
The counts are empty when I open the plugin. Counting can be slow on a big database, so counts are not refreshed on open. Click the refresh icons. In the full version you can switch on Auto-Refresh Counts.
A clean-up stops part way or shows errors. Lower Batch Size and raise Delay (in ms) under Settings & Logs, then run it again.
Post Types, Options and Cron are missing. They only show in Expert mode.
I deleted a cron job and it came back. The plugin that owns it is still active and schedules it again. Only leftovers from removed plugins stay gone.
Can an AI assistant clean my database? In the full version, yes, through OG AI Core's MCP server. Switch on MCP under Settings & Logs. The tools are for administrators only, and every deletion needs an explicit confirmation.
Uninstall¶
Deleting the plugin removes:
- every option whose name starts with
ogdbc_, including all settings and the licence record; - its scheduled jobs;
- its test table, if Dev Tools ever created one (full version).
Its log file in your uploads folder is removed too. Your database clean-ups are permanent and are not undone.
More reading: the OG Database Cleaner guide.