PHPackages                             sivaschenko/magento2-clean-media - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sivaschenko/magento2-clean-media

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

sivaschenko/magento2-clean-media
================================

Magento 2 media analysis and cleanup

1.1.1(5y ago)96244.6k↓47.6%33[6 issues](https://github.com/sivaschenko/magento2-clean-media/issues)[2 PRs](https://github.com/sivaschenko/magento2-clean-media/pulls)MITPHPPHP &gt;=7.1CI failing

Since Oct 12Pushed 2y ago4 watchersCompare

[ Source](https://github.com/sivaschenko/magento2-clean-media)[ Packagist](https://packagist.org/packages/sivaschenko/magento2-clean-media)[ RSS](/packages/sivaschenko-magento2-clean-media/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

Overview
========

[](#overview)

The module provides a command for retrieving information about catalog media files.

```
bin/magento si:catalog:media

Media Gallery entries: 17996.
Files in directory: 23717.
Cached images: 353597.
Unused files: 5847.
Missing files: 4.
Duplicated files: 157.

```

The following options include more details in the output:

- list all unused files with `-u` option
- list all files referenced in database but missing in filesystem with `-m` option
- list all duplicated files with `-d` option

Also it allows to clean up filesystem and db:

- remove unused files with `-r` option
- remove database rows referencing non-existing files with `-o` option
- remove duplicated files and replace references in database with `-x` option

Installation
============

[](#installation)

Run the following commands from the project root directory:

```
composer require sivaschenko/magento2-clean-media
bin/magento module:enable Sivaschenko_CleanMedia
bin/magento setup:upgrade

```

Usage
=====

[](#usage)

Information about media
-----------------------

[](#information-about-media)

```
bin/magento si:catalog:media

Media Gallery entries: 17996.
Files in directory: 23717.
Cached images: 353597.
Unused files: 5847.
Missing files: 4.
Duplicated files: 1.

```

List missing files
------------------

[](#list-missing-files)

```
bin/magento si:catalog:media -m

Missing media files:
/i/m/image1.jpg
/i/m/image2.jpg
/i/m/image3.jpg
/i/m/image4.jpg

Media Gallery entries: 17996.
Files in directory: 23717.
Cached images: 353597.
Unused files: 5847.
Missing files: 4.
Duplicated files: 1.

```

List unused files
-----------------

[](#list-unused-files)

```
bin/magento si:catalog:media -u

Unused file: /i/m/image5847.jpg
...

Media Gallery entries: 17996.
Files in directory: 23717.
Cached images: 353597.
Unused files: 5847.
Missing files: 4.
Duplicated files: 1.

```

Remove unused files
-------------------

[](#remove-unused-files)

```
bin/magento si:catalog:media -r

Unused "/m/i/mixer.glb" was removed

```

List duplicated files
---------------------

[](#list-duplicated-files)

```
bin/magento si:catalog:media -m

Duplicate "/i/m/image5847.jpg" to "/i/m/image5007.jpg"

Media Gallery entries: 17996.
Files in directory: 23717.
Cached images: 353597.
Unused files: 5847.
Missing files: 4.
Duplicated files: 1.

Removed unused files: 1.
Disk space freed: 1 Mb

```

Remove duplicated files
-----------------------

[](#remove-duplicated-files)

```
bin/magento si:catalog:media -x

Duplicate "/p/u/pub_1.jpg" was removed

Media Gallery entries: 2.
Files in directory: 4.
Cached images: 189.
Unused files: 2.
Missing files: 0.
Duplicated files: 1.

Removed duplicated files: 1.
Updated catalog_product_entity_varchar rows: 1
Updated catalog_product_entity_media_gallery rows: 1
Disk space freed: 1 Mb

```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~132 days

Total

3

Last Release

1825d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1443767?v=4)[sivashchenko](/maintainers/sivashchenko)[@sivashchenko](https://github.com/sivashchenko)

---

Top Contributors

[![sivaschenko](https://avatars.githubusercontent.com/u/2028541?v=4)](https://github.com/sivaschenko "sivaschenko (16 commits)")[![peterjaap](https://avatars.githubusercontent.com/u/431360?v=4)](https://github.com/peterjaap "peterjaap (3 commits)")[![tdgroot](https://avatars.githubusercontent.com/u/1165302?v=4)](https://github.com/tdgroot "tdgroot (1 commits)")

### Embed Badge

![Health badge](/badges/sivaschenko-magento2-clean-media/health.svg)

```
[![Health](https://phpackages.com/badges/sivaschenko-magento2-clean-media/health.svg)](https://phpackages.com/packages/sivaschenko-magento2-clean-media)
```

###  Alternatives

[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

68357.9k](/packages/run-as-root-magento2-prometheus-exporter)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[angeo/module-llms-txt

Magento 2 module for AI Engine Optimization (AEO). Generates spec-compliant llms.txt and llms-full.txt per llmstxt.org standard, plus streaming JSONL for vector indexing. Multi-store, multi-website, CLI, cron, async admin UI, Page Builder-aware sanitization, customer-group pricing, atomic writes, ETag/Cache-Control, .md mirrors.

111.1k](/packages/angeo-module-llms-txt)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
