Retention and deleting log entries
On this page
Control how long the email log keeps entries, how the daily cleanup works, and how to delete one, several or all entries yourself.
The email log should not grow forever. This article explains the Retention setting, the automatic daily cleanup, and the three ways to delete entries by hand. It is for administrators who manage disk space, privacy requests or data-keeping rules.
Set the retention period
Go to CRM-NG SMTP → Settings → Email Log. In the settings at the top, enter a number in Retention and press Save Local Logging Settings.
- The value is in days.
- The lowest value is 1, the highest is 365.
- The default is 30.
Choosing a value
| Your situation | Suggested retention |
|---|---|
| You store email bodies, which may hold reset links and personal data | 7 to 14 days |
| You only log basic details and want to spot problems | 30 days |
| You need a longer audit trail | 90 to 365 days, or export regularly |
Shorter is better for privacy. Longer is better for spotting slow patterns, such as a customer who says they have never received anything.
How the daily cleanup works
Once a day, CRM-NG SMTP deletes every log entry older than your retention period. For each removed entry it also deletes:
- its stored body and headers,
- its stored attachment files,
- its open and click tracking records.
The cleanup runs on WordPress's scheduled tasks (WP-Cron). WP-Cron runs when someone visits your site. On a very quiet site, or one where WP-Cron is turned off without a server cron job, the cleanup may run late. See Action Scheduler issues for how to set up a reliable cron.
Changing the value
If you lower the retention, older entries are removed at the next daily run, not straight away. If you raise it, entries already deleted do not come back.
The cleanup runs even when logging is turned off, so old entries still age out.
Delete one entry
- Open the entry
On the Email Log tab, click the subject of the email.
- Delete it
Press Delete log and confirm.
Delete several entries
- Tick the entries
Use the boxes at the left of each row. The box in the header row ticks every row on the current page.
- Delete them
Press Delete selected under the list and confirm.
Only the rows you ticked on the current page are deleted. Use the status menu and search box first to bring the right rows together. See Searching and filtering the email log.
Delete everything
At the bottom of the log list is Erase all local email data. It permanently removes every log entry, every stored attachment and every tracking event. You are asked to confirm. Your settings are kept.
This cannot be undone
There is no recycle bin. If you might need the records later, use Export CSV first. See Exporting the email log.
Privacy requests
If someone asks you to delete their data, search for their address, tick the matching rows and press Delete selected. Repeat for each page of results. Remember that other plugins, your mail service and the recipient's mailbox may hold their own copies.
When you uninstall
If Uninstall CRM-NG SMTP is turned on in the Misc tab, deleting the plugin also removes its database tables, including the email log. If it is off, the log stays in your database after the plugin is deleted. See Miscellaneous settings.
