The Home for Magento 2 Excellence

Quality-tested Magento 2 modules. Explore. Evaluate. Elevate. #magento2

1090 Modules
617 Ready
473 Need Help
🏆 Leaderboard
Actively Maintained v1.0.0

System Config File Cleanup for Magento 2

aimanecouissi/module-system-config-file-cleanup

Deletes previously uploaded media files when a Stores → Configuration file field is saved with a replacement or emptied, preventing orphaned files from accumulating in media storage.

1
Downloads
Below average
0
GitHub Stars
2mo ago
Last Release
0
Open Issues
Build Passing
Ready to install

Build Tests

Composer Install
DI Compile
Templates

Code Quality

CS Coding Standard
11 warnings
PHPStan Level 8

Tested on Magento 2.4.9

Recent Test History

Each release is tested against the latest Magento version at that time.

v1.0.0 on Magento 2.4.9
Jun 1, 2026

Share This Module's Status

System Config File Cleanup for Magento 2 Magento compatibility status badge

README

Loaded from GitHub

AimaneCouissi_SystemConfigFileCleanup

Deletes replaced or cleared media files from Stores → Configuration file fields. The module cleans up previously uploaded files when Magento system configuration file fields are saved with a replacement or empty value.

Installation

composer require aimanecouissi/module-system-config-file-cleanup
bin/magento module:enable AimaneCouissi_SystemConfigFileCleanup
bin/magento setup:upgrade
bin/magento cache:flush

Usage

When a Stores → Configuration file field backed by Magento\Config\Model\Config\Backend\File is saved with a replacement file or an empty value, the previously stored media file is deleted. Fields that keep the same file value leave the existing media file in place.

Uninstall

bin/magento module:disable AimaneCouissi_SystemConfigFileCleanup
composer remove aimanecouissi/module-system-config-file-cleanup
bin/magento setup:upgrade
bin/magento cache:flush

Changelog

See CHANGELOG for all recent changes.

License

MIT

This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.