---
title: Purge expired data
description: Learn about the options for purging expired data in PingDirectory.
component: pingdirectory
version: 11.1
page_id: pingdirectory:pingdirectory_server_administration_guide:pd_ds_purge_expired_data
canonical_url: https://docs.pingidentity.com/pingdirectory/11.1/pingdirectory_server_administration_guide/pd_ds_purge_expired_data.html
llms_txt: https://docs.pingidentity.com/pingdirectory/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
---

# Purge expired data

You can use a plugin or schedule a recurring task to delete expired data or clean up expired PingFederate persistent access grants.

The plugins run continuously, polling at configurable intervals, and are the simpler option for most deployments. The recurring tasks let you schedule cleanup to run at specific times, such as during a nightly maintenance window.

The following table compares the plugin and recurring task approaches to help you choose the best option for your deployment:

**Choosing between plugins and recurring tasks**

| Implementation | Recurrence                                              | Configuration                                                     | Use case                                                           |
| -------------- | ------------------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------ |
| Plugin         | Continuously, on a polling interval                     | One `dsconfig create-plugin` command                              | Near-real-time cleanup with minimal data accumulation between runs |
| Recurring task | On a defined schedule (for example, nightly at 2:00 AM) | Two `dsconfig` commands: one for the task, one for the task chain | Defined maintenance windows or off-peak scheduling                 |

Learn more about the data cleanup options in the following topics:

* [Working with the Purge Expired Data plugin](pd_ds_purge_expired_data_plugin.html)

* [Scheduling expired PingFederate grant cleanup as a recurring task](pd_ds_pf_grant_cleanup_recurring_task.html)
