AVAR Media Optimizer

Description

Clean up your WordPress Media Library, optimize images and reclaim server space — without taking unnecessary risks.

AVAR Media Optimizer combines a WordPress media cleaner, an image optimizer and a WebP/AVIF converter in one plugin. Find unused images, duplicate uploads and orphan files, reduce image file sizes, and review everything you remove before it is deleted permanently.

Why AVAR Media Optimizer?

  • Reclaim storage: Find unused media, duplicate images, stale thumbnails and orphan files in your uploads folder.
  • Optimize images: Compress JPEG, PNG and WebP files, scale down oversized uploads and generate WebP or AVIF versions (when your server supports them).
  • Clean up with more confidence: Review the scan results and move unwanted media to a restorable trash instead of deleting it immediately.
  • Keep control: Restore trashed media and, when an optimization backup is available, undo an image optimization.
  • Save maintenance time: Optimize new uploads automatically, schedule scans and let larger jobs run in the background.
  • Keep images on your server: Image optimization runs locally; your media is never uploaded to a third-party optimization service.

Find unused images before deleting them

Not sure which images are still in use? The media usage scanner checks for references in posts, pages, featured images, Gutenberg content, WooCommerce galleries, Elementor layouts, ACF fields, metadata, widgets and more.

Instead of calling every unreferenced file safe to delete, it sorts the results into three groups:

  • Used — a reference to the file was found.
  • Unused — no reference was found.
  • Verify manually — the result is uncertain, so the file is never treated as safe to remove automatically. Review these items before a cleanup.

No scanner can detect every reference created by custom code, external systems or unsupported plugins. Always review important files and keep an independent backup before a large cleanup.

Remove clutter beyond the Media Library

Files can remain in wp-content/uploads even when WordPress no longer lists them in the Media Library. The disk scanner helps you find orphan files, leftover thumbnails and other unregistered media, and review them before you act.

The duplicate image finder compares file content, so it detects identical uploads even when their filenames differ. You review the results and decide which copy to keep.

Compress images and convert to WebP or AVIF

Reduce the size of your existing images and, optionally, optimize new uploads as they arrive. AVAR Media Optimizer can:

  • Compress JPEG, PNG and WebP images.
  • Scale down new uploads that exceed your chosen maximum size.
  • Convert eligible images to WebP or AVIF, depending on what your server supports.
  • Serve the generated WebP/AVIF images to browsers that support them, with the original format as a fallback, wherever the plugin can update the image markup.
  • Keep a backup of the original image so an optimization can be undone (when backup storage is enabled and available).

Smaller image files can reduce bandwidth use and improve loading performance. Results depend on your original images, your server’s image libraries and your website’s configuration.

Clean up safely with a restorable media trash

Removing media can break a page, product or gallery if a reference was missed. That is why AVAR Media Optimizer moves media to a restorable trash before anything is permanently deleted.

Restore files, thumbnails and their WordPress attachment data, choose how long the trash keeps items, and delete permanently only when you are sure.

Extra safety check: While a file is in the trash, the plugin records requests for it that still reach WordPress, and shows the referring page when one is available — a sign that the file is probably still needed. Requests handled entirely by the web server, a cache or a CDN are not seen, so the absence of recorded requests does not prove that a file is unused.

More tools for busy websites

  • Media Replace: Replace an image while keeping its WordPress attachment ID, so standard references keep working.
  • Scheduled maintenance: Optional weekly scans, scheduled cleanup, trash retention and summary e-mails.
  • Bulk and background jobs: Work through large media libraries in manageable batches.
  • WP-CLI: Run scans and cleanups from the command line.
  • Diagnostics: Check your server’s image capabilities and whether the recovery storage is protected.

Get started in three steps

  1. Scan your Media Library.
  2. Review the results.
  3. Clean up what you no longer need — safely, through the restorable trash.

Privacy

Images are optimized on your own server; no media files or website content are sent to an external service. To confirm that its recovery storage is not publicly accessible, and whether requests for missing files reach WordPress, the plugin sends small requests to your own website. If your uploads are hosted on another domain, such as a CDN or object storage, that domain is contacted only when an administrator runs the external storage test in Diagnostics. While a file is in the trash, requests for it that reach WordPress are counted, and the address of the referring page is stored without its query string; no IP address, browser details or cookies are recorded.

Screenshots

Installation

  1. Install and activate AVAR Media Optimizer.
  2. Open Media Optimizer in the WordPress admin menu.
  3. Run your first media usage scan.
  4. Review the scan results, especially Verify manually items.
  5. Configure cleanup, trash retention, optimization and automation according to your website.

FAQ

Can AVAR Media Optimizer tell me exactly which images are safe to delete?

The plugin detects many common WordPress references, but no automated scanner can understand every custom theme, plugin or externally stored reference.

When a result is uncertain, AVAR Media Optimizer places it in Verify manually rather than automatically treating it as unused.

Always review important media before permanently deleting it.

Are files permanently deleted during normal cleanup?

No. Standard cleanup moves media to the plugin’s restorable trash first.

Items remain recoverable until they are permanently purged manually or according to your configured retention rules.

Can deleted media be restored?

Media moved through the plugin’s trash workflow can be restored together with the files and WordPress data required by the recovery process.

Can the plugin find files that are not in the Media Library?

Yes.

The disk scanner examines the WordPress uploads folder and can identify orphan files, stale thumbnails, WebP/AVIF copies whose original is gone and other files that are not associated with a Media Library attachment.

Can it detect duplicate images with different filenames?

Yes.

Duplicate detection compares file content, so identical files can be identified even when their filenames are different.

Does image optimization use an external service?

No.

Image optimization runs locally on your WordPress server. Media files are not uploaded to an external optimization service.

Why can’t I generate WebP or AVIF?

WebP and AVIF availability depends on the image-processing libraries installed on your server.

Check Media Optimizer > Diagnostics to see the capabilities detected on your hosting environment.

Can I restore an image after optimization?

If optimization backups are enabled and a recovery copy is available, the original image can be restored.

Does the plugin automatically contact my CDN or external storage?

No.

If uploads are served from another domain, AVAR Media Optimizer does not automatically contact it while checking storage protection.

You can explicitly run the external storage test from Diagnostics if you want to verify the configuration.

What happens when I uninstall the plugin?

By default, recovery data needed to restore trashed or optimized media is preserved.

Administrators who intentionally want to remove plugin data and recovery files can enable the complete removal option before uninstalling.

Does it support WordPress Multisite?

Network-wide activation is not supported.

Activate and configure the plugin separately for each individual site.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“AVAR Media Optimizer” is open source software. The following people have contributed to this plugin.

Contributors

Translate “AVAR Media Optimizer” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.23.0

  • Added: images used only as a social share image (og:image) are now detected, including those set in All in One SEO.
  • Added: Disk files shows what links to each file, and the page it was found on.
  • Added: the trash records when something still asks for a file it is holding, and which page asked.
  • Added: the avar_mo/external_tables filter for plugins that keep media references in their own tables.
  • Fixed: deleting an image, “Delete all next-gen”, Media Replace and full uninstall could delete another image whose file is named like a WebP/AVIF copy (photo.jpg.webp next to photo.jpg).
  • Fixed: a critical error with AVAR Analytics 1.2.2 active, and on hosts that disable disk_free_space.
  • Fixed: media in use could be offered for cleanup when it was shown only by a gallery, playlist, video or audio shortcode without an ids list or file, or by a gallery shortcode in a widget.
  • Fixed: media in use could be offered for cleanup when its use was added after the last scan or during a scan, written as an encoded URL, stored deep in a JSON gallery or saved as a text theme setting, or when a scan was canceled at its last step.
  • Fixed: Disk files listed WebP/AVIF copies as orphans, and could trash a copy an image still serves when its list came from a scan made before updating.
  • Fixed: on MySQL 8 and newer, one very long value in the database could make every scan fail.
  • Fixed: restoring from the trash stripped backslashes from titles, metadata and block content.
  • Fixed: moving to the trash and restoring required 500 MB of free disk space, even for a small file.
  • Fixed: a move to the trash that another plugin blocked could still remove the attachment’s files.
  • Fixed: optimizing an animated PNG or WebP turned it into a still image.
  • Fixed: next-gen conversion ignored its quality setting and, on some servers, could write a stray .jpg file.
  • Fixed: optimizing on upload discarded image data added by other plugins.
  • Fixed: on multisite, uninstall ignored each site’s own “delete plugin data” choice.
  • Fixed: Media Replace failed for photos over 2560 px or with EXIF rotation, and did not say why a replace failed.
  • Fixed: bulk actions could stop partway or run past PHP time limits without reporting what was left, and the bulk action dropdown below a table was ignored.
  • Fixed: the Optimize tab said optimization was paused when “Optimize anyway, without keeping a recovery copy” was selected.
  • Fixed: wp avar-mo trash purge deleted permanently without asking for confirmation (use --yes to skip the prompt).
  • Fixed: the explanation of “Verify manually” results could appear in the wrong language, and named reasons that are not plugins as if they were.
  • Fixed: PHP warnings when the uploads folder is not writable.
  • Note: run a scan after updating.

1.22.4

  • Initial WordPress.org release.