Drupal is a registered trademark of Dries Buytaert

file_metadata_cleaner

17 sites No security coverage
View on drupal.org
File Metadata Cleaner

Automatically removes sensitive or unwanted metadata from uploaded files to protect privacy and streamline content moderation workflows.

Introduction

When users upload images, PDFs, or other media, those files often contain embedded metadata such as GPS coordinates, author names, device info, or revision history. This module ensures that such metadata is automatically cleaned from files on upload or via manual admin actions — reducing privacy risks and keeping your file system clean.

Solution: File Metadata Cleaner provides an extensible framework for detecting and removing embedded metadata from supported file types using configurable processors.

Features

  • ✅ Automatically removes metadata on file upload (configurable).
  • 🧼 Manual “Clean Metadata” operation available per file.
  • 🧩 Plugin-based architecture for file-type-specific processors (e.g., JPEG, PDF).
  • 🧪 Extensible for custom processors via plugin system.
  • 🔎 Admin overview page per file showing metadata status.

Use cases

  • Government or educational websites where privacy of media is crucial.
  • Agencies handling client files with confidential embedded information.
  • Any site that wants to prevent unnecessary metadata from being stored in the file system.

Requirements

This module requires:

Without ExifTool, metadata cleaning will not function.

Installation

  1. Install the module via Composer:

    composer require drupal/file_metadata_cleaner
    
  2. Enable the module via the UI at /admin/modules
    or use Drush:

    drush en file_metadata_cleaner
    
  3. Ensure the ExifTool binary is installed via Composer:

    composer show ahmetburkan/exiftool-binary
    

Configuration

After installation:

  1. Visit the module’s configuration page at:
    /admin/config/media/file-metadata-cleaner

  2. Options:

    • Enable or disable automatic metadata cleaning on upload.
    • Configure specific file processors (e.g., JPEG, PDF).
    • Customize processor behavior (e.g., strip all metadata or preserve specific fields).
  3. To manually clean an existing file’s metadata, go to:
    /admin/content/files/metadata/{file_id}

  4. Permissions:

    • Users must have the edit file metadata cleaner settings permission to access the configuration UI.
    • Users that have the access files overview permission can view/clean metadata on the page /admin/content/files.

Additional Recommendations

  • Media: For better file/media entity integration.
  • ExifTool: Standalone tool used internally for metadata operations.

Similar Projects

  • ExifTool (Drupal): Exposes ExifTool metadata, but does not clean/remove.
  • Exif: Displays metadata but doesn't clean it.
  • EXIF Manipulate: Deletes JPEG EXIF metadata, but limited in scope.

What makes File Metadata Cleaner different:
It’s focused on privacy-first cleanup, not just reading metadata. It integrates cleanup directly into file workflows.

Supporting this Module

If this module helps your project, consider supporting its development by:

Community Documentation

Nothing yet. Want to contribute one?

Notes

  • Works with Drupal 10 and 11.
  • Developers can easily extend this module by creating their own FileMetadataCleanerProcessorPlugin implementations.
  • Each processor has its own configuration screen for advanced options (e.g., always strips everything and can configure what to keep).

Future To-Do List

🖼 Support for additional image formats:

  • AVIF
  • HEIF / HEIC
  • GIF
  • PNG
  • WebP

🎞 Support for video formats:

  • MP4
  • MOV

📥 Add a queuing system to:

  • Process older images in bulk.

Maintainers

Activity

Total releases
4
First release
May 2025
Latest release
9 months ago
Release cadence
0 days
Stability
50% stable

Release Timeline

Releases

Version Type Release date
1.0.x-dev Dev May 21, 2025
1.0.2 Stable May 21, 2025
1.0.1 Stable May 21, 2025
0.9.x-dev Dev May 20, 2025