Delete Product Images

  • 100%
  • Item Number (EMMO): dpi-00
$49.99
plus shipping and handling
$49.99
Links
1
1
Add to Wishlist

You removed a photo from the product gallery. The file often stays in pub/media/catalog/product. Over years that folder grows, backups get heavy, and the server still holds files Magento no longer lists. This CLI walks that directory, checks the media gallery table, and flushes files that have no row.

Mock first. Flush when the list looks right.

A live run asks you to confirm. --run-mock prints every path it would delete and never touches the disk. Both runs report megabytes and file count.

Learn more ›

Only files Magento no longer references

A file on disk is not the same as a file Magento still knows. The command looks for files under pub/media/catalog/product when the gallery table has already forgotten them.

Learn more ›

CLI and SSH only

There is no Admin button. Run it from Magento CLI on staging, then production, with a backup in your pocket. Keep it off the storefront and out of daily merchandising.

Learn more ›

A catalog past 500 GB can give a lot back

One customer described clearing more than 120 GB from a catalog images directory that had grown past 500 GB. How much you recover depends on how many unreferenced files your Magento install still holds.

Learn more ›

What the command does

See it first --run-mock prints every path it would delete. Nothing is removed until you run without that flag and confirm.
Confirm to flush The live command is the same one without --run-mock. Type yes at the prompt.
MB and file count Each path is written to the terminal. The summary is unused size in MB and how many files were processed.
Recover storage Leftover product image files in pub/media/catalog/product after gallery edits, imports, and deleted products.

What stays, and what goes

Still in the gallery table A matching value in catalog_product_entity_media_gallery means the file is referenced. It stays on disk, including cache copies of those images.
On disk, no gallery row Under pub/media/catalog/product with no corresponding gallery record. These are the leftovers after gallery edits, imports, and deleted products.
Cache of kept images Cache copies of referenced product images stay. This flush is not Magento’s Flush Catalog Images Cache button.

Use it when

Media is fat and Magento already forgot the files.

  • You replaced or removed product images for years.
  • A catalog import left unused files on disk.
  • Backups and disk usage are climbing on pub/media.
  • You can run a mock on staging first.

Do not use it when

The file is still the live gallery image.

  • You have no filesystem or media backup.
  • You need to delete one SKU’s images from Admin. Use the product gallery.
  • A CDN or another server holds media Magento’s table does not know about.
  • You have not run --run-mock and read the list.

Back up media first. A live flush deletes files. There is no restore in the module. Snapshot pub/media, or the whole disk, mock on staging, then production.

Before you run it

Still-used images It keeps files that still have a media gallery row. Always mock first and read the list.
Preview before delete Yes. --run-mock reports the paths and never deletes.
Admin button No. Magento CLI over SSH only. This is not a merchandising tool.
Restore No. A live flush is permanent. Keep a media backup. There is no recycle bin.
One product’s images Admin gallery edits one SKU. This finds files Magento’s gallery table no longer references. There is no “delete this product’s images” screen.
Which directory Product media under pub/media/catalog/product.

Five steps. Read the mock list.

  1. 1Enable Emmo_FlushImages and run setup:upgrade. Unzip the package as app/code/Emmo/FlushImages.
  2. 2Copy pub/media/catalog/product, or take a server backup.
  3. 3bin/magento emmo:images:flush-unused --run-mock
  4. 4Same command without --run-mock. Type yes at the prompt.
  5. 5Open a few products. Confirm gallery images still render. Note the MB freed.

No Admin button. No recycle bin. No screen that deletes one product’s images. It only removes files Magento’s media gallery table no longer references. Magento Open Source and Adobe Commerce. PHP 8.1–8.5. CLI and SSH. Command: emmo:images:flush-unused, with --run-mock to preview. Support: [email protected]

More Information

More Information
Follow Meta Tag Please Select

Reviews

  1. Overall Rating
    100%
    Excellent Extension
    Revamped my store by clearing out loads of unused product images. The support team swiftly tackled an installation hiccup. Thumbs up
  2. Overall Rating
    100%
    unique extension
    Absolutely unique extension! It's the first of its kind that I've come across. Incredibly useful—I'm excited to use it, I wasted plenty of money buying additional space on server! but, now it allowed me to empty the media folder from unwanted images. Awesome, thanks EMMO team.
  3. Overall Rating
    100%
    This extension is a lifesaver!
    This extension is a lifesaver! It effortlessly removes unwanted images, boosting my store's performance. Installing it was easy, and it worked like a charm right out of the box, so no need to reach out to support. Highly recommended
  4. Overall Rating
    100%
    a real time-saver
    Handling our website's media is now super easy! This tool is a real time-saver, streamlining the backend tasks effortlessly
  5. Overall Rating
    100%
    A reliable module that works just as needed
    Great product and great support, highly recommended
  6. Overall Rating
    100%
    Fixed my media directory
    My media directory was messed up! this saved my life. The extension is good and the support is quick and efficient.
  7. Overall Rating
    100%
    Removed more than 120GB
    Our catalog images directory was huge and more than 500GB was used by images only. We were able to remove more than 120GB with this extension. Support was really quick to guide us on it's usage
Write Your Own Review
Only registered users can write reviews. Please Sign in or create an account