Data Management
SettingsThe Data Management section controls how long the audit log is kept and whether all plugin data is deleted when Learnomy is removed. It is a small section with big consequences, so the uninstall option is off by default.
What you can do#
- Set how many days the audit log keeps entries before they are removed automatically.
- Choose whether removing the plugin also permanently deletes all of its data.
- Keep your student progress, transactions, and other data safe by default if you ever reinstall.

How to use it#
Step 1 -- open Data Management#
Go to Learnomy Settings and click Data Management in the sidebar.
Step 2 -- set log retention#
In the Data Retention card, switch on Remove old log entries and set how many days to keep. It applies to the audit log and the Payment Log. Audit log entries and incoming-sale calls older than this are removed automatically. For Stripe and PayPal events only the stored details are removed; the event ID is kept, so a replayed event is still refused. Open reports in Reported Content, and Payment Log events that failed or are still pending, are never removed this way; once dealt with they follow the same retention. The default is 365. There is no enforced minimum, so a small number here really does prune aggressively - set 30 or more unless you have a reason not to.
Step 3 -- decide the uninstall behavior#
Set the On Uninstall toggle, Remove all plugin data when the plugin is deleted:
- Off (default and recommended) -- deleting the plugin keeps all your data, so a reinstall picks up where you left off.
- On -- deleting the plugin permanently drops every course, enrollment, certificate, and transaction. This cannot be undone. The warning note under the toggle spells this out.
Step 4 -- save#
Click Save Changes.
Settings and options#
| Field | Option key | Notes |
|---|---|---|
| Log Retention | data_retention_days |
Days to keep. Default 365. Off (keep everything) is stored as 0. |
| Email Log Retention | email_log_retention_days |
Days to keep sent-email records. Off (keep everything) is stored as 0. |
| On Uninstall | delete_data_on_uninstall |
Toggle. Off by default. When on, uninstall wipes all plugin data. |
For developers#
Uninstall is handled by uninstall.php, which only performs a destructive cleanup when opted in. Two flags are honoured for backward compatibility:
learnomy_settings['delete_data_on_uninstall'] === 1-- the current canonical flag set by the toggle above.learnomy_settings['uninstall_data'] === 'delete_everything'-- a legacy enum from pre-2026-05-16 installs, still respected.
When neither is set (or both are falsy) the safe default is to keep all data. When opted in, uninstall.php drops every lrn_* table, deletes all learnomy_* options, user meta, and transients, removes the lrn_student and lrn_instructor roles, and cancels all scheduled learnomy_* cron and Action Scheduler jobs.