Flamingo is quietly bloating your database
Flamingo stores every Contact Form 7 submission in your database: every legitimate inquiry, every spam message that slipped past your honeypot, and every test submission you sent yourself during development. It does this silently, indefinitely, with no built-in expiry. Sites that have been running CF7 and Flamingo for two or three years can accumulate tens of thousands of rows in the flm_inbound_messages and flm_outbound_messages tables.
That weight shows up in your database size, in slower admin queries, and in bloated backups. The spam folder alone can dwarf your legitimate messages by a factor of ten.
What most people do
DELETE FROM statement works once you get the table name right, the date format right, and the type filter right. One typo against a production database with no dry-run and no undo is a bad afternoon.A better way: date-filtered deletion with a built-in dry run
TrueCommander's clear flamingo command deletes Flamingo messages by date range and type: spam only, non-spam only, or everything. Pass -dry-run=true and the command counts the matching messages and returns the total without touching a single row. Confirm the number looks right, then run again without the flag to delete. You choose what to keep and what to remove.
Always dry-run first. The -dry-run=true flag counts matching messages without deleting anything. You see the exact number before committing. The type filter means you can target spam only and leave every real customer inquiry untouched.
How it works
-from, -to, -type, and -dry-run=true. The command queries both inbound and outbound tables, counts the matching rows, and returns the total. Nothing is touched.-dry-run=true (or set it to false) and run again with the same parameters. The command deletes only the rows that match your date range and type filter. Recent messages outside the range are untouched.| Detail | Value |
|---|---|
| Command name | clear flamingo |
-from | Start date, format YYYY-MM-DD. Messages on or after this date are included in the match. |
-to | End date, format YYYY-MM-DD. Messages on or before this date are included in the match. |
-type | One of spam, non-spam, or all. Filters by Flamingo's own spam classification. |
-dry-run | If true, counts matching messages across both inbound and outbound tables without deleting. Omit or set false to delete. |
| Scope | Covers both flm_inbound_messages and flm_outbound_messages in one pass |
| Can be used in |
Real example
You take on a client site that has been running Contact Form 7 and Flamingo for four years. The database export is 1.8 GB. You open phpMyAdmin and find that flm_inbound_messages alone accounts for 900 MB: 67,000 rows of which 58,000 are spam.
You run tp clear flamingo -from=2020-01-01 -to=2023-12-31 -type=spam -dry-run=true. The count comes back: 57,441 spam messages in that range. The number looks right. You drop the dry-run flag and run it live. The command deletes all 57,441 rows in a few seconds. The database drops to under 400 MB. Backups now fit within the hosting plan's quota again.
You put the same command on a monthly schedule, targeting the previous month's spam, so the cleanup happens automatically from now on.
Goes further with TrueCommander
tp clear flamingo -type=spam on the first of each month. Flamingo spam never accumulates again and your database size stays predictable.create site backup earlier in the same maintenance macro so you have a restore point before the purge runs. The whole sequence takes one click.