Sign inBlogAboutSupportContact
Tools

Clear out Flamingo contact-form message bloat and spam in one command

Delete Flamingo inbound and outbound messages by date range and type. Dry-run first to see the count, then delete with confidence. No phpmyadmin, no manual SQL, no guesswork.

3 min read May 2026 clear flamingo

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 manually from the Flamingo admin screen The Flamingo UI lets you select messages and delete them page by page. With thousands of messages that means hundreds of clicks. It also offers no date filter, so you cannot keep recent messages while clearing the old ones.
Write a raw SQL query in phpmyadmin A 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.
Ignore it and hope it doesn't matter Flamingo bloat is one of those problems that feels low priority until your database export hits 2 GB and your hosting plan's backup quota fills up. By then cleaning it is urgent and you have less room to be careful.

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.

TrueCommander
Dry run complete
No rows deleted yet
4,821 spam messages matched2024
Date range 2024-01-01 to 2024-12-31
Re-run without dry-run to deletesafe

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

1
Dry-run to count what will be deleted Pass -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.
2
Run live to delete the matched rows Remove -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.
3
Schedule it so the bloat never comes back Put the live command on a monthly schedule targeting spam from the previous month. The database stays lean automatically and your backups stay small.
DetailValue
Command nameclear flamingo
-fromStart date, format YYYY-MM-DD. Messages on or after this date are included in the match.
-toEnd date, format YYYY-MM-DD. Messages on or before this date are included in the match.
-typeOne of spam, non-spam, or all. Filters by Flamingo's own spam classification.
-dry-runIf true, counts matching messages across both inbound and outbound tables without deleting. Omit or set false to delete.
ScopeCovers 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

Ready?

Clean up Flamingo in seconds.

One of 91 commands. All included with every license.

Cookies. The short version.

Essential cookies keep the cart and theme working. Analytics only fire if you say yes. Read our policy.