# How long Royal AI Firewall keeps its logs

> Royal AI Firewall keeps 7 days of bot logs. What the daily cleanup removes, how to change the window with a filter, Erase all logs, and uninstall.

- Canonical: <https://royalplugins.com/support/royal-ai-firewall/log-retention/>
- Last updated: 2026-11-14
- HTML version: <https://royalplugins.com/support/royal-ai-firewall/log-retention/>

---

Royal AI Firewall keeps **7 days** of AI bot activity. Once a day it removes anything older, so the database stays small without any work from you. This page covers what is stored, what the daily cleanup removes, how to keep logs for longer, the **Erase all logs now** button, and what happens to your data when you uninstall.

Where to find these settings

Everything on this page lives under **AI Firewall → Settings → Data** in your WordPress admin.

## What the firewall stores

The firewall writes to four kinds of records:

| Record | What it holds | Kept for |
| --- | --- | --- |
| **Request log** | One row per AI bot request: time, bot, verification result, IP address, user agent, method, URL, page type, response status and size, the policy decision and its reason, the Content Signals verdict and the Web Bot Auth result. Royal MCP tool calls and Abilities API calls are stored here too. | Your retention window (7 days by default) |
| **Daily summaries** | Hits per bot per day, rebuilt every hour from the request log. | Your retention window |
| **Page-type summaries** | Hits per bot per page type per day, used by the page-type tile and heatmap. | Your retention window |
| **Bot access baseline** | Daily counts of verified search engine visits (Googlebot, Bingbot, Applebot, DuckDuckBot), used by the Bot Access page to spot a sudden drop. | 30 days, separately |

Your per-bot policies, settings and the bot catalog are not logs. They are never removed by the cleanup.

## What the daily cleanup removes

A WP-Cron task runs once a day and deletes rows older than the retention window from the request log, the daily summaries and the page-type summaries. Each run works for up to 20 seconds, so a very large backlog is cleared over several days. All three use the same window: summaries are not kept longer than the rows they were built from.

On busy sites the cleanup deletes in batches, so it never locks the log table for long.

The log has a per-minute cap

To keep a flood from one bot from filling your database, the firewall writes at most 300 log rows per bot per minute. Requests over the cap are still blocked, rate limited or paywalled as usual; they just are not written to the log. Developers can change the cap with the `raif_log_rows_per_minute` filter.

## Keep logs for longer (or shorter)

The Settings page shows the window in use (7 days unless you change it). To use a different window, add the `raif_log_retention_days` filter in a small must-use plugin or a code snippets plugin:

```
<?php
// wp-content/mu-plugins/raif-log-retention.php
add_filter( 'raif_log_retention_days', function () {
    return 30; // days
} );
```

- **Allowed range:** 1 to 365 days. A value above 365 is treated as 365. A value below 1 falls back to 7, so logs can never be kept forever by accident.
- **When it takes effect:** at the next daily cleanup. A shorter window removes the extra rows then.
- **Going longer does not bring rows back.** Anything the cleanup already removed is gone; the longer window applies from now on.
- **Bigger window, bigger table.** The dashboard still shows the last 24 hours and the last 7 days. The extra history is what you see in **AI Firewall → Activity Log**.

Developers who want to act after each cleanup can hook `raif_log_pruned`. It receives the number of request-log rows removed and the cutoff time.

## Erase all logs now

To start over with an empty log, go to **Settings → Data → Erase invocation log** and click **Erase all logs now**. Confirm the prompt and the firewall empties:

- the request log
- the daily summaries
- the page-type summaries

It keeps:

- your per-bot policies and every setting
- the bot catalog
- the bot access baseline, so search engine monitoring and alerts keep working
- the database tables themselves (they are emptied, not removed)

This cannot be undone

Erased rows are gone for good. Your policies and settings are not affected.

## Your data when you deactivate or uninstall

### Deactivating

Deactivating stops the firewall's scheduled tasks and takes its entries back out of supported page caches' user-agent lists. Logs, policies and settings stay, so reactivating picks up where you left off.

### Uninstalling (default: keep everything)

By default, deleting the plugin keeps all of its data. A reinstall finds your logs, policies and settings as you left them.

### Uninstalling and deleting everything

#### Turn on the delete option

In **Settings → Data → Uninstall behavior**, tick **Delete all logs, tables, and options when the plugin is uninstalled** and click **Save changes**.

#### Deactivate and delete

In **Plugins**, deactivate Royal AI Firewall, then click **Delete**.

With the option on, uninstall removes the plugin's five database tables, its options and cached values, and its scheduled tasks. One setting shared with SEObolt Pro (the self-check signing key) is kept while SEObolt Pro is installed. On a multisite network each site that turned the option on is cleaned; sites that did not keep their data. Settings that belong to other plugins (for example Elementor's Agent Ready settings) stay with those plugins.

## Still stuck? Two support paths

### Community support (free): wp.org plugin forum

Post a new thread at [wordpress.org/support/plugin/royal-ai-firewall/](https://wordpress.org/support/plugin/royal-ai-firewall/). The Royal Plugins team monitors the forum regularly.

### Premium support (paid)

For direct one-on-one help with a 24-hour SLA, see [Premium Support](https://royalplugins.com/premium-support/) ($149/year).

#### Information to include (either path)

- Your Royal AI Firewall version (from **Plugins**)
- Whether you set `raif_log_retention_days`, and to what value
- Whether WP-Cron runs on your site (some hosts disable it and run a server cron instead)
- Roughly how many rows your request log holds, if you know

## Keep reading

[Keeping blocked bots out of page caches

What the firewall syncs for you, and copy-paste rules for nginx, Varnish and Cloudflare.](https://royalplugins.com/support/royal-ai-firewall/page-caches/)
[Royal MCP and Royal AI Firewall together

How bot policies apply to MCP requests and what the MCP activity widget shows.](https://royalplugins.com/support/royal-ai-firewall/royal-mcp-and-firewall/)
[Privacy and telemetry

What the plugin sends (nothing, by default) and what stays on your server.](https://royalplugins.com/support/royal-ai-firewall/#privacy)

[Royal AI Firewall Documentation](https://royalplugins.com/support/royal-ai-firewall/)
[Premium Support](https://royalplugins.com/premium-support/)
