🔥 Black Friday Sale: Get 65% OFF Any PageForge Pro Plan! Use code BF65 Claim Offer →
Konto Get it free
Post Media Cleanup icon
aktiv gepflegt Getestet bis 7.0.9 #68 in attachments

Post Media Cleanup

Post Media Cleanup removes orphaned media files from your server when you permanently delete a post.

Aktive Installationen20+10+ Stufe
Downloads · 30d110▼ -12.7% vs prev. 30d
Wertung—0 Bewertungen
Gesundheits-Score62/100Gut
Downloads aller Zeiten564Seit Jul 2026
Unterstützung gelöst1 / 1100% in den letzten 2 Monaten
erfordertWP 5.0PHP 7.4+
Downloads · 7d16▼ -59% week over week
Unser Urteil

Solide Wahl

Post Media Cleanup is a solid plugin choice in 2026, with a few things worth checking first. It runs on 20+ sites and was last updated 2 months ago, and scores 62/100 on our health check.

  • Kleine Benutzerbasis (20+ aktive Installationen)
  • Bisher sehr wenige Bewertungen

Wie stapelt es sich?

Side-by-side bei Installationen, Updates, Bewertungen und Support

Tägliche Downloads

112334Sep 4Oct 18Dec 2
Gestern4
Täglicher Durchschnitt (1 Jahr)4
Spitzentag46Sep 26, 2026
Letzte 12 Monate568

Download-Spitzen folgen normalerweise einer neuen Version - jede Website, die automatisch aktualisiert wird, gilt als Download.

Ranglisten

Where Post Media Cleanup stands today

WordPress.org Ranglisten suchen

Live-Position in der Plugin-Suche, Top 100
StichwortPositionKonkurrierende PluginsKategorie
attachments >100 4,387 Best attachments plugins →
Aufräumen #69 7,103 Beste Cleanup-Plugins →
delete >100 10,000 Best delete plugins →
images >100 10,000 Best images plugins →
media >100 10,000 Best media plugins →

Versionsübernahme

Anteil aktiver Sites pro Release.

  • 2.4100.0%

About Post Media Cleanup

From the official readme · v2.4.0

Beschreibung

Post Media Cleanup removes orphaned media files from your server when you permanently delete a post.

When you permanently delete a post, this plugin automatically finds and removes:

  • Ausgewähltes Bild
  • Images and files embedded in post content
  • PDFs and any linked files in content
  • All attachments uploaded directly to the post

Hauptmerkmale

  • Only fires on permanent deletion — moving to trash is always safe
  • Skip Shared Media — never deletes a file used by another post
  • Works per post type — configure exactly which types trigger cleanup
  • Compatible with S3 and cloud storage
  • Multisite ready
  • Developer friendly — filter hooks to extend behaviour

For Developers

Add extra attachments to the deletion list:

add_filter( 'postmediaweb_attachment_ids_to_delete', function( $ids, $post_id ) {
    $extra = get_post_meta( $post_id, 'my_custom_pdf', true );
    if ( $extra ) $ids[] = (int) $extra;
    return $ids;
}, 10, 2 );

Prevent a specific attachment from being deleted:

add_filter( 'postmediaweb_should_delete_attachment', function( $should, $att_id, $post_id ) {
    if ( $att_id === 999 ) return false;
    return $should;
}, 10, 3 );

Installation

  1. Upload the plugin folder to /wp-content/plugins/
  2. Activate through the Plugins screen
  3. Go to Settings → Post Media Cleanup to configure

Änderungsprotokoll

Important safety release: fixes several cases where in-use media could be deleted, and closes a privilege gap. Review the Bulk Orphan Cleanup results again after updating.

2.4.0

  • Fixed (data loss): Elementor images inside repeaters (slides, tabs, icon lists, nested containers) were not recognised as “in use”, so a shared image could be deleted. Media controls are now found at any depth.
  • Fixed (data loss): images referenced from CSS url(...), or after a domain change / http-https mix / CDN or S3 URL, were not recognised as “in use”. Usage is now matched by upload-relative path, independent of host.
  • Fixed (data loss): the Bulk Orphan Cleanup flagged files used by widgets, theme mods, menus, page-builder meta, user meta and ACF fields on terms/users/options pages. These are now checked.
  • Fixed (data loss): the scanner flagged media belonging to posts in the Trash, so restoring a post could lose its images. Only attachments with no existing parent are now reported, and trashed posts count as references.
  • Fixed (data loss): a “scaled” image’s original file, and WebP/AVIF siblings, are now treated as the same media.
  • Fixed: unchecking every post type silently re-enabled “post”; “none selected” now really deletes nothing.
  • Fixed: fatal error on WordPress 5.0 – 5.4 when deleting a post (hook argument added in 5.5).
  • Fixed: a failure inside the plugin could block a post from being deleted; errors are now contained.
  • Fixed: fatal error on hosts without the PHP DOM extension.
  • Fixed: bulk delete sent every ID in one request and was truncated by max_input_vars; it now runs in batches with a progress bar.
  • Fixed: the post-type warning script was never loaded; the admin CSS depended on an unreliable style handle; the delete button label was built by string-replacing a translatable string.
  • Fixed: the WooCommerce setting was reset to “off” on each save while WooCommerce was inactive.
  • Fixed: ACF repeater / flexible content / group handling now reads stored references (any nesting depth) instead of altering ACF’s global loop state.
  • Fixed: libxml error handling is restored after parsing; video, audio, source, embed, object and iframe uploads are now collected from content.
  • Security: a logged-in user can only trigger deletion of media they are allowed to delete (filter postmediaweb_enforce_capabilities).
  • Security: bulk delete re-validates on the server that each ID is an attachment, still an orphan, still unreferenced and deletable by the user.
  • Security: hardened AJAX input handling (nested arrays no longer become ID 1, request size capped, wp_unslash applied).
  • Security: results of the postmediaweb_attachment_ids_to_delete filter are validated; index.php guards added.
  • Performance: ACF, Elementor, WooCommerce-gallery and content checks use narrow, targeted SQL instead of loading every row that contains a digit.

2.3.1

  • Fixed: shared product-description images are preserved when content uses a resized image URL.
  • Fixed: a product’s own variation-image references no longer prevent those variation images from being cleaned up.
  • Fixed: variation images are collected even when the variations have already been moved to the trash.

2.3.0

  • Added WooCommerce product gallery image collection on product delete
  • Added WooCommerce product variation image deletion
  • Added short description media scanning for all post types
  • Added dedicated WooCommerce settings section (visible only when WooCommerce is active)
  • Improved post type selector UI with Built-in vs Custom grouping
  • Added post type descriptions for known third party types
  • Added warning when no post types are selected

2.2.0

  • Fixed: an image shared across multiple WooCommerce product galleries (_product_image_gallery) was deleted when only one of those products was removed, even though other products still used it.
  • Fixed: an image referenced only inside Elementor content/templates (_elementor_data) was deleted once its original post was removed, even though Elementor still referenced it elsewhere.
  • Fixed: “Skip Shared Media” only ever checked the featured-image meta and a literal URL match in post content — it now also checks WooCommerce product galleries, Elementor data, ACF image/file/gallery fields (including repeater and flexible-content sub-fields), term meta (e.g. category thumbnails), Gutenberg image/gallery blocks, [gallery ids="..."] and WPBakery shortcodes, and known media-holding site options (custom logo, site icon).
  • Fixed: the Bulk Orphan Cleanup scanner used the same narrow “featured image + literal URL” check and could flag genuinely-used media as orphaned for all the reasons above.
  • Changed: media-reference detection is conservative by design — a bare numeric value that happens to match an attachment ID (e.g. a generic custom field) is never treated as a confirmed reference on its own; only meta keys/structures positively identified as media storage (WooCommerce, Elementor, ACF field definitions, etc.) count.
  • Added: the Bulk Orphan Cleanup deletion step now re-checks each attachment immediately before deleting it, instead of trusting the scan result alone — anything found to have become referenced since the scan (e.g. the site changed while a large scan was running) is skipped rather than deleted, and the admin UI now reports how many were skipped for this reason.
  • Added: media-reference detection is now shared between the real-time “Skip Shared Media” check and the Bulk Orphan Cleanup scanner (Postmediaweb_Reference_Checker), so the two can no longer disagree with each other.

2.1.0

  • Fixed: deleting a post with a populated ACF gallery field could crash with a fatal error on PHP 8+ (missing return value in the gallery field handler).
  • Fixed: the Settings tab could not save changes due to a settings-group name mismatch.
  • Fixed: the Bulk Orphan Cleanup tab’s Scan/Delete buttons had no JavaScript attached and did nothing, because jQuery was never enqueued on that page.
  • Fixed: reactivating the plugin silently reset your saved settings back to defaults.
  • Fixed: the orphan scanner could exhaust available memory on large sites by loading all post content and all attachment records into memory at once.
  • Fixed: the orphan scanner’s content-matching was far slower than intended at scale; it now uses a single indexed pass instead of a full-text scan per attachment.
  • Fixed: attachments whose parent post no longer exists were permanently hidden from orphan scans instead of being correctly flagged.
  • Fixed: a PHP notice could be triggered by certain Elementor widget settings during media detection.
  • Improved: fewer database queries when scanning ACF fields on each deleted post.

2.0.0

  • Added ACF Free and Pro support
  • Added Bulk Orphan Cleanup tool with progress indicator
  • Added tabbed settings interface

Vollständiges Änderungsprotokoll auf WordPress.org →

Für Entwickler

Ist das dein Plugin? Zeigen Sie die Zahlen.

Fügen Sie Ihrer Website, Docs oder GitHub Readme ein Live-Badge hinzu. Es wird von selbst aktualisiert - kein Konto erforderlich.

Aktiv installiert Badge Bewertungsabzeichen Gesundheits-Score-Abzeichen

Best Post Media Cleanup alternatives

All attachments plugins →
Alternativen
Rang Plugin Aktive Installationen Wertung Aktualisierten Gesundheit
1 Export media with selected content (by DKZR) Export media with selected content (by DKZR) Include all relevant attachments in your export. by joost de keijzer 40K+ ★★★★★★★★★★ 4.5 (93) vor 7 Tagen 89
2 Datei-Upload-Typen von wpforms Datei-Upload-Typen von wpforms Erlauben Sie WordPress ganz einfach, jede Dateityperweiterung oder einen MIME-Typ zu akzeptieren und hochzuladen, einschließlich… von Syed Balkhi 40K+ ★★★★★★★★★★ 4 (20) Vor 2 Tagen 85
3 Lightbox with PhotoSwipe Lightbox with PhotoSwipe Integration of PhotoSwipe (http://photoswipe.com) for WordPress. von Arno Welzel 20K+ ★★★★★★★★★★ 4.9 (116) Vor 6 Tagen 92
4 Unique Headers Unique Headers Add unique custom header images to individual pages, posts, categories, or tags. Von Ryan Hellyer 10K+ ★★★★★★★★★★ 4.9 (160) vor 7 Monaten 73
5 Media Deduper Media Deduper Save disk space and bring some order to the chaos of your media library by removing and… by cornershop 8K+ ★★★★★★★★★★ 3.8 (44) Vor 12 Monaten 44
6 Document Gallery Document Gallery This plugin generates thumbnails for documents and displays them in a gallery-like format… by Dan Rossiter 8K+ ★★★★★★★★★★ 4.8 (112) Vor 1 Monat 88
7 Anhänge herunterladen Anhänge herunterladen Download Attachments ist ein neuer Ansatz zum Verwalten von Downloads in WordPress. Es erlaubt Ihnen… von dFactory 8K+ ★★★★★★★★★★ 4.5 (46) Vor 6 Tagen 91
8 Responsive WordPress Slider – HG Slider Responsive WordPress Slider – HG Slider A responsive image rotator plugin that easily creates WordPress slideshows. Now 100%… by richardgabriel 7K+ ★★★★★★★★★★ 3.8 (12) Vor 6 Jahren 36
9 forumAttachments for bbPress forumAttachments for bbPress Implement attachment upload to the topics and replies in bbPress plugin through a media… by Milan Petrovic 6K+ ★★★★★★★★★★ 4.3 (26) Vor 3 Wochen 90
10 Anhang Importeur Anhang Importeur Importieren Sie Anhänge aus einem anderen WordPress-Blog mithilfe einer WXR-Datei. Von Spencer Piontkowski 3K+ ★★★★★★★★★★ 4.3 (26) Vor 12 Jahren 42

Fragen und Antworten

Post Media Cleanup: quick answers

Gerade Antworten, gezogen von Live WordPress.org Daten.

Quelle: WordPress.org

Is Post Media Cleanup free?

Yes. Post Media Cleanup is free to download and use from the official WordPress.org plugin directory.

Is Post Media Cleanup safe to use in 2026?

Post Media Cleanup is a solid plugin choice in 2026, with a few things worth checking first. It runs on 20+ sites and was last updated 2 months ago, and scores 62/100 on our health check.

How many websites use Post Media Cleanup?

Post Media Cleanup is active on 20+ WordPress websites and has been downloaded 564 times since it launched in July 2026. It was downloaded 110 times in the last 30 days.

Does Post Media Cleanup work with WordPress 7.1?

Post Media Cleanup is officially tested up to WordPress 7.0.9, while the latest release is 7.1.5. It may still work, but try it on a staging site first.

What PHP version does Post Media Cleanup need?

Post Media Cleanup requires PHP 7.4 or higher. Most hosts run PHP 8.x today, so it works on any modern WordPress hosting.

When was Post Media Cleanup last updated?

The latest version, 2.4.0, was released on October 9, 2026 (2 months ago).

Who makes Post Media Cleanup?

Post Media Cleanup is developed and maintained by iftiarhossain.

What are the best alternatives to Post Media Cleanup?

The most popular alternatives to Post Media Cleanup are Export media with selected… (40K+ installs), File Upload Types by WPForms (40K+ installs) and Lightbox with PhotoSwipe (20K+ installs).

Angetrieben von PageForge

Eine Vorlage und eine Tabelle. Eine echte Seite für jede Suche.

PageForge Verwandelt jede Zeile eines CSV in eine WordPress-Seite mit eigenem Titel, URL, SEO Felder und Schema entworfen. Kostenlos auf WordPress.org.

  • CSV und XLSX, plus Google Sheets auf Beruf und Unternehmen
  • seinen eigenen Titel, URL, SEO Felder und Schema für jede Seite
  • Arbeitet mit dem Blockeditor, Elementor, Divi und Avada
  • Kostenlos auf WordPress.org, keine Kreditkarte

↑↓ bewegen↵ öffnen