Skip links
View Categories

Data retention, cleanup tasks and database size caps

1 min read

Opti-Behavior cleans up after itself. This page explains the retention rules, the scheduled tasks that apply them, and the tools to act by hand. Everything is under Settings → Danger Zone, tabs Smart Cleanup and Auto Schedule.

Retention periods #

Data Retention card: spam and bot sessions purged every day, heavy files after 90 days, detailed data after 365 days, dashboard summaries kept forever
Smart Cleanup → Data Retention.
DataDefaultNotes
Spam, bot and automated sessionsPurged every dayAutomatic
Heavy files (recordings, raw heatmap files)90 daysNever longer than the detailed-data period
Detailed data (sessions, events, per-visitor rows)365 daysUp to 10 years
Dashboard summariesKept foreverCharts and totals keep working after the details expire

Database size caps #

Under Advanced, set an optional global cap and a per-table cap (off by default). When a cap is reached, the oldest raw rows go first; the last 7 days and dashboard summaries are always kept, and at most 25% of a table is removed per run.

Manual cleanup #

Manual Cleanup with the number of bot, spam and automated records detected and the Clean Bot/Spam Traffic button, conditional cleanup rules and Repair and Archive
Manual Cleanup shows what is detected right now.
  • Clean Bot/Spam Traffic – deletes now the sessions classified as spam, bot or automated (normally done daily).
  • Conditional Cleanup rules (expert) – delete sessions matching your own rules; preview before running.
  • Repair & Archive – repair tools for heatmap files.
Purge cache after funnel modification setting and Data integrity check and recovery with Run data check
Cache purge after funnel changes, and the data integrity check.
  • Purge cache after funnel modification – clears page caches when a funnel changes, so cached pages use the new funnel steps.
  • Data integrity check & recovery – finds missing or inconsistent records and repairs what it can.

Cleanup tasks #

Cleanup Tasks table with each task, frequency, next run, last run and Run now buttons
Auto Schedule → Cleanup Tasks.
TaskWhat it does
Daily data retentionRemoves expired visitor data
Bot/spam traffic cleanupRemoves spam, bot and automated sessions
Conditional cleanup rulesApplies your expert rules
Archived heatmap data purgeDeletes archived heatmaps after 30 days
A/B testing data cleanupRemoves old raw A/B data; results are kept
Database size capApplies your caps
Database schema upkeepDrops duplicate indexes, converts tables to InnoDB, optimises fragmented tables
Archive-page heatmap cleanupArchives category/tag/search heatmaps
Recording & event file cleanup (Pro)Deletes expired recording files
Storage limit check (Pro)Enforces the recording storage limit

Run now queues one task; Run all now queues them all, spaced out. Tasks run in small background batches, so they never block your site.

Scheduled Auto-Cleanup with frequency, maximum sessions per run, optimize tables and recalculate spam options, and last result
Scheduled Auto-Cleanup for the conditional rules.
Cleanup History entries with task, scheduled, completed and what was deleted
Cleanup History: every run, with what it deleted.

Cleanup History folds repeated runs that deleted nothing into one line, and only says “deleted” when something was deleted.

Expected result #

Storage stays stable over time, and Cleanup History shows each task running on schedule.

FAQ #

Tasks show “Not scheduled”. #

WP-Cron is not running. Visit the site or set a server cron, then click Run all now.

Will retention delete my charts? #

No. Dashboard summaries are kept forever.

Leave a comment

Explore
Drag