Local Data Sanitiser Module Adds CLI Tools for Cleaning Drupal Databases
New Drupal module Local Data Sanitiser provides command-line tools for removing or anonymising personal data from local copies of Drupal databases. Designed for developer workflows, the module operates exclusively through Drush and does not provide an interface within the Drupal administration UI.
The module includes functions such as deleting Webform submissions when the Webform module is enabled, anonymising non-administrator user accounts, and cleaning customer or contact data stored in content entity fields. Developers can select specific sanitisation tasks to run, enabling targeted data handling based on project requirements.
Before execution, the tool displays a preview of affected record counts and issues warnings about destructive actions, including confirmation of the detected environment. By default, it refuses to run outside a recognised local environment unless explicitly overridden with a force flag, adding a safeguard against unintended data modification.
The module uses a modular task-plugin system, allowing additional sanitisation routines to be added over time. It requires Drupal 10.3 or Drupal 11 and depends on Drush for execution. Optional integrations include Webform for submission cleanup and Config Filter for excluding the module from exported configuration in local environments.
The project was created by Lakshman Kumar Pandey and is supported by Un.titled for development and maintenance. The project documentation notes that it is not covered by Drupal’s security advisory policy, placing responsibility for evaluation and usage on developers.

