Part of the Entity ecosystem · 309 projects
Need to share a copy of your site with a developer or a contractor, without sharing your users' personal data? Entity Anonymizer replaces that data with realistic fake values, for good.
drush sql:sanitize only cleans a few database tables. Your custom fields, old revisions, translations, files and URL aliases keep the real data. This module cleans all of them.
There is no undo. Take a backup first and always start with a dry run.
Features
- Cleans every revision and every translation.
- Replaces images and files with placeholders and deletes the originals.
- Rebuilds or removes URL aliases, so a name never stays in a path.
- Gives the same fake value for the same source value, so your relations and unique fields keep working.
- Lets you choose per content type: anonymize, skip or delete.
- Drush commands to run, resume and check the result, including a scan for personal data that survived.
- Keeps an audit trail of what was changed and why, without storing any personal value.
Use it for development, staging or training copies, for data handed to a third party, or to erase the data of people who asked for it. The module never guesses: a field you did not declare is never touched, and the check command tells you about it.
Post-Installation
- Enable the module and its UI submodule.
- Open Configuration, Development, Entity Anonymizer and go through the five tabs: General, Behavior, Base fields, Content types and Reasons.
- For your own fields, use the anonymization section on each field's edit form.
- On the copy of production only, enable the Sanitize submodule, then run
drush ea:run --dry-run, then the real run, thendrush ea:verify.
Never enable the Sanitize submodule on your production site.
Additional Requirements
- Drupal 11.4 or 12, PHP 8.3 or higher.
- The Faker library, installed by Composer.
- Drush 13 for the command line tools.
Recommended modules/libraries
- Pathauto: rebuilds aliases from your patterns.
- Paragraphs: paragraph revisions are cleaned with their host.
Similar projects
drush sql:sanitizeworks in SQL on a few known tables. It skips custom fields, revisions, translations, files and aliases.
Supporting this Module
Bug reports and merge requests are welcome in the issue queue.
Community Documentation
To understand the logic, read these three documents in this order:
- WORKFLOWS: what happens, and when.
- BUSINESS_RULES: the numbered rules the code follows.
- DESIGN: why it is built this way.
The Demo submodule builds a sample online shop, so you can test a full run on fake data first.
Ask your assistant about Entity Anonymizer
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
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.
More in the Entity ecosystem
Most installed first
Activity
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 1.0.0-alpha1 | Pre-release | 11 | PHP 8.3 | Oct 31, 2026 |