Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

This module provides a way to automatically delete old content from your Drupal site based on criteria you define, like deleting nodes older than a certain date. It can also be used to purge other entity types or specific items like abandoned shopping carts.

The Entity Purge modules provides a system for purging Drupal entities. For example, daily delete all entities of type X that are older than 1 month.

Features

  • It provides a purge plugin that allows you to delete during cron entities based on their age.
  • For Commerce users, it provides a purge plugin that allows you to delete Commerce carts during cron based on their creation time.
  • Custom plugins can be written that can collect the entities to be deleted based on custom criteria.
  • Automated unit tests, so that you can sleep at night.

Usage

Currently, there is no UI. Configuration entities must be created by a developer and imported via Drush or the config UI.

As an example, to delete all nodes older than 45 days, create a file at "config/sync/entity_purge.type.my_app_old_nodes.yml" with the following content. You may change the ID of the purge type from "my_app_old_nodes" to whatever suits your case.

langcode: en
# Purges for types disabled here will not be executed. 
status: true
dependencies:
  module:
    - node
id: my_app_old_nodes
label: 'Old content items'
description: 'Purges content items older than 45 days, 200 at a time.'
plugin_id: age
plugin_config:
  # Enable debugging for testing. No entities will be deleted.
  # Use with logging enabled.
  # debug: true
  # Enable logging to monitor which entities are being deleted.
  # log: true
  # Purges will be automatically run via cron. Set to `custom`
  # if you want to call the purger yourself in your code. 
  scheduler: cron
  entity_type_id: node
  # Change to `changed` to delete nodes based on their last
  # updated time. 
  field_name: created
  # Minimum age in seconds; nodes older than this will be
  # deleted.
  min_age: 3888000
  # Do not increase this limit too much. Rather, if you have
  # too many items regularly generated - such as logs,
  # set the cron to run more frequently using a module like
  # Ultimate Cron.
  limit: 200

Import the configuration, then export it so that you get the uuid property assigned by the system.

Additional Requirements

This module only requires Drupal core versions 9+, and PHP 8+.

Supporting this Module

Create issues in the Drupal.org queue, submit MRs. If you are interested in sponsoring this module to add more features, contact the module maintainers.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Jun 2025
Latest release
1 week ago
Releases (12 mo)
1 ▼ from 2
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.0.0-beta5 Pre-release 9–11 Aug 24, 2026
1.0.0-beta4 Pre-release 9–10 Jun 24, 2025
1.0.0-beta3 Pre-release 9–10 Jun 24, 2025