---
title: "xConnect purging tool"
slug: "xconnect-purging-tool"
abstract: "Overview of the xConnect purging tool that lets you clean up unnecessary analytical data."
---
# xConnect purging tool

The purging tool lets you clean up unused analytical data to release the space and remove irrelevant data.

The purging tool lets you:

- Purge contacts that did not interact with the site for a specified amount of days, anonymous contacts, or contacts filtered by [custom conditions](https://doc.sitecore.com/xp/en/developers/105/sitecore-experience-platform/walkthrough--customizing-contact-purge-conditions.html "Walkthrough: Customizing contact purge conditions").
- Purge interactions started some days ago or use additional filtering by events, channels, or custom conditions.

You can initiate a purge task through a [Web API request](https://doc.sitecore.com/xp/en/developers/105/sitecore-experience-platform/web-api-for-xconnect-data-tools.html "Web API for xConnect Data Tools") or the [DevEx CLI xConnect plugin](https://doc.sitecore.com/xp/en/developers/105/sitecore-experience-platform/xconnect-devex-cli-plugin.html "xConnect DevEx CLI plugin").

> [!important]
> Create a backup for the [collection database](https://doc.sitecore.com/xp/en/developers/104/platform-administration-and-architecture/en/xdb-collection-database.html) before a purge task is registered. After creating a purge task, there is no immediate ability to cancel or pause the task. You might lose some of the data due to purging after a cancellation.

## Technical details

The purging tool uses the [Cortex Processing Engine](https://doc.sitecore.com/xp/en/developers/105/sitecore-experience-platform/sitecore-cortex-processing-engine.html "Sitecore Cortex Processing Engine") and [contact and interaction data extraction](https://doc.sitecore.com/xp/en/developers/105/sitecore-experience-platform/extracting-contacts-and-interactions.html "Extracting contacts and interactions") to extract data from the collection database and deletes filtered contacts and interactions through the [client API](https://doc.sitecore.com/xp/en/developers/105/sitecore-experience-platform/xconnect-client-api-overview.html "xConnect Client API overview").

## Scalable Reads and the purging tool

The purge process consists of two steps:

- Extract data in batches from the collection database.
- Delete contacts and interactions based on the provided options.

You can optimize the purge process by enabling the [Scalable Reads](https://doc.sitecore.com/xp/en/developers/104/platform-administration-and-architecture/en/xconnect-scalable-reads.html) feature on xConnect.

Scalable Reads can route data extraction processes to the secondary node of the replicated collection database. When deleting data, operations run against the primary node.