---
title: Setting up automatic web analytics data cleanup
related:
  - https://docs.kentico.com/13/on-line-marketing-features/managing-your-on-line-marketing-features/web-analytics/viewing-web-analytics-reports.md
  - https://docs.kentico.com/13/on-line-marketing-features/configuring-and-customizing-your-on-line-marketing-features/configuring-web-analytics/web-analytics-api.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

You can configure the system to automatically delete old web analytics data that is no longer needed. The deletion is performed by the **Remove analytics data** global [scheduled task](https://docs.kentico.com/13/configuring-xperience/scheduling-tasks.md). By default, this task is disabled to prevent unwanted deletion of data.

To enable automatic data removal for web analytics:

1. Open the **Scheduled tasks** application.
2. Select _(global)_ in the **Site** selector.
3. **Edit** () the **Remove analytics data** scheduled task.
4. Configure how often the system runs the task using the scheduling options (Period, Start time, Every, Between, Days).
5. Specify how old data must be before the task is allowed to remove it.
   - Type a number into the **Task data** field. This number indicates age in days, so the default value of _720_ sets the task to delete only data that is approximately two years old.
6. Select the **Task enabled** check box.
7. Click **Save**.

The system regularly runs the task according to the set task interval and deletes all web analytics data older than the number of days specified in the **Task data** field.
