Data Retention
LicenceForge automatically manages the lifecycle of transient and log data through scheduled cleanup tasks. This page documents what data is retained, for how long, and how to configure retention periods where supported.
Warning
Deleted data is unrecoverable. If you need historical audit logs, webhook events, or analytics data for compliance or reporting purposes, export it before the retention period expires. See Backup & Restore for export commands.
Retention Periods Overview
The following table summarises the retention policy for each data type. Permanent data is never automatically deleted by the maintenance system.
| Data Type | Table | Retention | Configurable | Cleanup Trigger |
|---|---|---|---|---|
| Products | wplf_products |
Permanent | N/A | N/A |
| Product prices | wplf_product_prices |
Permanent | N/A | N/A |
| Licenses | wplf_licenses |
Permanent | N/A | N/A |
| Activations | wplf_activations |
Permanent | N/A | N/A |
| API keys | wplf_api_keys |
Permanent | N/A | N/A |
| Audit logs | wplf_audit_log |
90 days (default) | Yes (7–365 days) | wplf_daily_maintenance |
| Webhook events | wplf_webhook_events |
30 days | No (hardcoded) | wplf_daily_maintenance |
| Analytics data | wplf_analytics |
365 days | No (hardcoded) | wplf_cleanup_analytics (weekly) |
| Rate limit transients | WordPress transients | 1 minute | No (auto-expire) | WordPress transient expiry |
Configuring Audit Log Retention
The audit log retention period is controlled by the wplf_audit_retention_days option. The default value is 90 days. You can set it to any value between 7 and 365 days.
Via the Admin Panel
Navigate to LicenceForge > Settings > Health Alerts and adjust the Audit Log Retention (days) field. Click Save Changes to apply.
Via WP-CLI
# View current retention period
wp option get wplf_audit_retention_days
# Set retention to 180 days
wp option update wplf_audit_retention_days 180
Note
Changes to the retention period take effect on the next daily maintenance run. Existing records older than the new retention period will be deleted at that time.
Automatic Cleanup Process
Data cleanup is handled by the WPLF_Maintenance class and runs as part of the scheduled cron jobs.
- Daily — The
wplf_daily_maintenancecron event triggerscleanup_old_audit_logs()andcleanup_old_webhook_events(). - Weekly — The
wplf_cleanup_analyticscron event performs an additional analytics cleanup pass as a safety net alongside the daily cleanup.
Each cleanup function deletes records in batches to avoid long-running queries on large tables.
Manual Cleanup
You can trigger all maintenance tasks immediately without waiting for the next scheduled run.
Via the Admin Panel
Navigate to LicenceForge > Settings and click the Run Maintenance Tasks button. This executes all daily maintenance sub-tasks, including data cleanup.
Via WP-CLI
wp cron event run wplf_daily_maintenance
wp cron event run wplf_cleanup_analytics
Permanent Data
The following data types are never automatically deleted by LicenceForge. They persist until you manually remove them or uninstall the plugin with the Delete all data option enabled.
- Products (
wplf_products) — Product definitions, versions, and metadata. - Product prices (
wplf_product_prices) — Pricing tiers and WooCommerce product mappings. - Licenses (
wplf_licenses) — All license records regardless of status. - Activations (
wplf_activations) — Active site registrations (deactivated entries are removed immediately, not by retention policy). - API keys (
wplf_api_keys) — All API keys, active and revoked.
Rate Limit Transients
Rate limiting data is stored as WordPress transients with a 1-minute expiry. These transients are automatically cleaned up by the WordPress transient system and do not require manual intervention. They do not appear in any LicenceForge database table.
Related Pages
- Cron Jobs & Scheduled Tasks — How cleanup tasks are scheduled and executed
- Backup & Restore — Export data before retention-based deletion
- Health Checks — Monitoring maintenance task execution
- Privacy & GDPR — Data export and erasure for compliance