Unused Media Checker

Опис

English

Unused Media Checker helps you identify, inspect, and safely remove unused media files from your WordPress Media Library.

The Media Library scan runs in small, resumable batches instead of one long request. This reduces the risk of gateway timeouts on sites with large media libraries. If the scan page is closed or reloaded, returning to the page resumes the saved scan progress.

Version 1.4.0 has been tested on development and staging installations with Media Libraries containing more than 6,000 files. Actual scan time depends on the hosting environment, content volume and enabled integrations.

The plugin analyzes your site and lists attachments that are not referenced in:

  • Posts, pages, and all public custom post types (including featured images/thumbnails)
  • Post content (Gutenberg blocks and classic content with wp-image-ID classes)
  • Direct image URLs from the uploads folder (wp-content/uploads/...)
  • Advanced Ads (media referenced via the advanced_ads_media meta)
  • Theme Customizer (site logo, site icon, header image, background image – including retina variants)
  • Rank Math FAQ blocks (images stored in FAQ block attributes)
  • Photo Gallery (10Web): optional filename-based warning in the unused list (usage is not mapped via attachment IDs)

Key features:

  • Resumable AJAX batch scan with progress display for large Media Libraries
  • Persistent scan snapshots for fast pagination and safer deletion checks
  • Clear list of potentially unused attachments with thumbnails, title, date and quick “Inspect” link
  • Accurate detection that respects logos, favicons, featured images and common SEO/ads integrations
  • Bulk delete with nonce protection and clear success messages – no unexpected white screens
  • Safe individual delete buttons per item with confirmation dialog
  • Pagination and list rendering powered by WordPress’s native WP_List_Table class
  • Optional Photo Gallery (10Web) helpers:
    • Media Library warning when a file with the same name exists in Photo Gallery
    • Photo Gallery files report (uploads/photo-gallery/) with grouping and an “unused motif” filter
  • Fully translation-ready via the textdomain unused-media-checker

Deutsch

Unused Media Checker hilft Ihnen, ungenutzte Dateien in Ihrer WordPress‑Mediathek zu identifizieren, zu überprüfen und sicher zu entfernen.

Der Mediathek-Scan läuft in kleinen, fortsetzbaren Arbeitsschritten statt in einer einzigen langen Anfrage. Dadurch sinkt bei großen Mediatheken das Risiko eines Gateway-Timeouts. Wird die Scan-Seite geschlossen oder neu geladen, setzt das Plugin den gespeicherten Fortschritt beim nächsten Aufruf fort.

Version 1.4.0 wurde in Entwicklungs- und Staging-Installationen mit Mediatheken mit mehr als 6.000 Dateien getestet. Die tatsächliche Scandauer hängt vom Hosting, dem Inhaltsumfang und den aktivierten Integrationen ab.

Das Plugin analysiert Ihre Website und listet Anhänge, die nicht referenziert werden in:

  • Beiträgen, Seiten und allen öffentlichen Custom Post Types (inkl. Beitragsbilder/Thumbnails)
  • Beitragsinhalten (Gutenberg‑Blöcke und klassischer Editor mit wp-image-ID‑Klassen)
  • Direkt eingebundenen Bild‑URLs aus dem Uploads‑Ordner (wp-content/uploads/...)
  • Advanced Ads (Medien im Meta‑Feld advanced_ads_media)
  • Theme‑Customizer (Website‑Logo, Website‑Icon, Header‑Bild, Hintergrundbild – inkl. Retina‑Varianten)
  • Rank‑Math‑FAQ‑Blöcken (Bilder in den FAQ‑Block‑Attributen)
  • Photo Gallery (10Web): optionaler Dateinamen‑Hinweis in der Unused‑Liste (Nutzung wird nicht über Attachment‑IDs gemappt)

Funktionen:

  • Fortsetzbarer AJAX-Batch-Scan mit Fortschrittsanzeige für große Mediatheken
  • Persistente Scan-Snapshots für schnelle Paginierung und sicherere Löschprüfungen
  • Übersichtliche Liste potenziell ungenutzter Anhänge mit Vorschaubild, Titel, Datum und “Inspect”‑Link
  • Präzise Erkennung, die Logos, Favicons, Beitragsbilder und gängige SEO/Ads‑Integrationen berücksichtigt
  • Massenlöschung mit Nonce‑Schutz und klaren Erfolgsmeldungen – keine unerwarteten weißen Seiten
  • Sicheres, einzelnes Löschen je Datei mit Bestätigungsdialog
  • Massenaktionen und Paginierung basierend auf der WordPress‑Klasse WP_List_Table
  • Optionale Photo Gallery (10Web) Hilfen:
    • Warnhinweis in der Mediathek‑Unused‑Liste, wenn ein gleichnamiges File in Photo Gallery existiert
    • Report für Photo Gallery Dateien (uploads/photo-gallery/) inkl. Gruppierung und Filter „Nur ungenutzte Motive“
  • Übersetzungsbereit über die Textdomain unused-media-checker (z. B. Deutsch, Englisch und weitere Sprachen)

Privacy

The plugin processes site content and media information locally in the WordPress installation. It does not send scan data to an external service. Scan progress and result snapshots are stored in the site’s WordPress database.

Support

For issues or questions, visit:
https://derwebfuchs.de/wordpress-mediathek-aufraumen-unused-media-checker/

Встановлення

  1. Download the plugin ZIP file.
  2. In the WordPress admin, go to Plugins > Add New Plugin > Upload Plugin and select the ZIP.
  3. Activate the plugin through the Plugins menu.
  4. Open Unused Media Checker > Media Library.
  5. Select the desired scan mode and integrations under Unused Media Checker > Settings.
  6. Click “Start new scan” and wait until the new result snapshot is complete.
  7. Inspect the results and begin with a small deletion batch.

Create a full backup of the database and uploads directory before permanently deleting media. Testing the cleanup on a staging site first is strongly recommended.

Часті питання

Will deleting unused media files affect my site?

No. Only files identified as unused are listed. Use the “Inspect” button to verify before removal.

Why aren’t my AdvancedAds images listed?

Media used in AdvancedAds is automatically detected and excluded from the list.

Do I need any settings?

No. The plugin provides defaults, while the settings page lets you choose the scan mode and optional integrations.

Why does the scan run in several steps?

Large scans can exceed PHP, proxy or web-server request limits. Version 1.4.0 processes the scan in small AJAX batches and stores its progress. If the page is closed or reloaded, return to Unused Media Checker > Media Library to resume the scan.

Can the plugin scan a large Media Library?

Version 1.4.0 has been tested with more than 6,000 media files on development and staging installations. Results and scan times can vary depending on hosting resources, site content and enabled integrations.

Why did deleting media not immediately reduce my hosting storage?

Items moved to the Media Library trash may still consume storage until they are permanently deleted. WordPress also creates resized variants, and hosting storage counters may update with a delay. Ask your hosting provider what is included in its storage calculation.

Should I create a backup first?

Yes. Back up the database and uploads directory and, where possible, test permanent deletion on a staging site first.

Відгуки

09.02.2026
This is a differentiated app with many features. Questions about how to use it are answered quickly.Highly recommended!
Прочитати всі 1 відгук

Учасники та розробники

“Unused Media Checker” — проект з відкритим вихідним кодом. В розвиток плагіну внесли свій вклад наступні учасники:

Учасники

Перекладіть “Unused Media Checker” на вашу мову.

Цікавитесь розробкою?

Перегляньте код, перегляньте сховище SVN або підпишіться на журнал розробки за допомогою RSS.

Журнал змін

1.4.0

  • Changed the Media Library scan to a resumable, AJAX-based batch process to prevent gateway timeouts on large sites.
  • Added persistent scan snapshots for fast pagination, inspection and safe deletion.
  • Added scan progress, automatic resume after reloading the page and stale-result detection after content changes.
  • Clarified progress and completion details with checked-media and unused-media totals; previous results are hidden while a new scan runs.
  • Improved deletion safety by requiring a current completed scan.
  • Performance-tested with more than 6,000 media files on development and staging installations.
  • Tested with WordPress 7.1.

1.3.7

  • New scan modes:
    • Quick scan (faster, may miss usage) — trash only
    • Thorough scan (recommended) — can delete permanently
  • New deep scan options (Thorough scan only): Widgets and Uploaded-to
  • Performance: conservative caching for aggregated “used attachment IDs” and cache invalidation on relevant content changes
  • Performance: reduced DB query load in Media Library list rendering
  • Performance: improved cache-miss scan performance for large sites
  • Inspect: cached detected usage sources for faster repeated inspections
  • Developer: optional profiling output via ?umc_profile=1 to diagnose slow scans (time, queries, cache hit/miss)
  • Fix: improved PHP 8+ compatibility for cache invalidation hooks

1.3.6

  • Photo Gallery (10Web): show a warning in the Media Library unused list when a file with the same name exists in Photo Gallery
  • Photo Gallery (10Web) files report: improved motif grouping so imported Media Library variants (imported_from_media_libray/.original + thumb) are grouped consistently

1.3.5

  • Improved pagination UX after deletions:
    • stay on the current page when deleting a single item
    • automatically fall back to the last valid page if a page becomes empty
    • only show the “No unused media found” message when all unused items are really gone

1.3.4

  • Tested with WordPress 6.9 and updated compatibility headers
  • Fixed nonce handling for bulk actions to avoid “Security check failed” errors from unrelated POST requests
  • Prevented blank pages after deletion and improved success notices directly on the Unused Media Checker screen
  • Greatly improved detection of used media:
    • scans all public post types (not only posts/pages)
    • detects direct image URLs from the uploads folder
    • includes Theme Customizer media (logo, site icon, header/background images, retina variants)
    • recognizes images used in Rank Math FAQ blocks

1.3.3

Removed unused CSS/JS – now relies on native List Table styles

Updated version and README

1.3.2

Removed script.js and style.css enqueue

1.3.1

Added Inspect button before delete

1.3.0

Database queries with LIMIT/OFFSET

WP_List_Table integration

AdvancedAds support

Centralized capability and nonce checks