DX Delete Attached Media
by Mario Peshev 4.9 (28 reviews)

DX Delete Attached Media

Automatically deletes attached media from posts and custom post types added via the Media button.

DX Delete Attached Media ranks #3,888 among WordPress.org plugins with 3,000+ active installations, is #454 of 6,651 in the Media category, a 4.9/5 rating from 28 reviews, and was last updated Oct 25, 2026. Data from WordPress.org, refreshed twice daily — see methodology.

Compatible with WP 7.1
v2.1.0 Current Version v2.1.0
Updated 1 week ago Last Update on 25 Oct, 2026
Refreshed 1 week ago Last Refreshed on
#454 of 6,651 in Media Top 5% by installs Downloads -81.7% this week Actively maintained
View on WordPress.org
Rank
#3,888
— No change
Active Installs
3K+
-23.2%
KW Avg Position
53.5
— No change
Downloads
54.8K
+32 today
Support Resolved
0%
— No change
Rating
98%
Review 4.9 out of 5
4.9 (28 reviews)

Next Milestone 4K

Total Progress 88.8%
3K+ 4K+
279
Ranks to Climb
-
Growth Needed
8,000,000
Active Installs
Pro

Unlock Exact Install Count

See the precise estimated active installs for this plugin, calculated from real-time ranking data.

  • Exact install estimates within tiers
  • Track install growth over time
  • Milestone progress predictions
Upgrade to Pro
Need 112 more installs to reach 4K+

Rank Changes

3,694 3,791 3,888 3,985 4,082 31-10-2026 01-11-2026 02-11-2026 03-11-2026 04-11-2026 05-11-2026 06-11-2026 07-11-2026
3,882 3,888 3,894 3,899 3,905 23-10-2026 24-10-2026 25-10-2026 26-10-2026 27-10-2026 28-10-2026 29-10-2026 30-10-2026 31-10-2026 01-11-2026 02-11-2026 03-11-2026 04-11-2026 05-11-2026 06-11-2026 07-11-2026
Current #3,888
Change
Best #

Upgrade to Pro

Unlock 30-day and 90-day rank history charts with a Pro subscription.

Upgrade Now

Active Installs Growth

Active Installs 0,000,000+
Growth +0.0%
Peak 0,000,000

Downloads Growth

30 40 50 60 70 31-10-2026 01-11-2026 02-11-2026 03-11-2026 04-11-2026 05-11-2026 06-11-2026 07-11-2026
0 200 400 600 800 1K 23-10-2026 24-10-2026 25-10-2026 26-10-2026 27-10-2026 28-10-2026 29-10-2026 30-10-2026 31-10-2026 01-11-2026 02-11-2026 03-11-2026 04-11-2026 05-11-2026 06-11-2026 07-11-2026
Downloads
Growth
Peak

Upgrade to Pro

Unlock 30-day, 90-day, and yearly download history charts with a Pro subscription.

Upgrade Now

Reviews & Ratings

4.9
28 reviews
Overall 98%
5
27 (96%)
4
0 (0%)
3
0 (0%)
2
1 (4%)
1
0 (0%)

Security History

Source: WPVulnerability

2 known vulnerabilities on record · 0 in the last 24 months · checked 2 months ago

  1. DX Delete Attached Media [dx-delete-attached-media] < 2.0.6 (closed)

    CVE-2023-46073 · Fixed in v2.0.6

  2. DX Delete Attached Media [dx-delete-attached-media] < 2.0.3 (closed)

    Fixed in v2.0.3

TL;DR

AI summary of the plugin's readme

This plugin is for WordPress site owners and administrators managing media attachments on posts and custom post types. It solves the problem of orphaned media files remaining after a post is deleted, since WordPress core deletes posts without removing their related images.

  • Deletes attached media automatically
  • Works with custom post types
  • Removes unused solo attachments
  • WooCommerce integration
  • Easy Digital Downloads integration

Frequently Asked Questions

Common questions about DX Delete Attached Media

Yes, as long as you attach images via the Media button, they are going to be deleted once the post/post type entry is deleted.
It works for all of your deleted posts, as long as you delete them from the system. Keep in mind that the soft delete sends your post to Trash first, and deleting the media would happen once your Trash is being emptied.
Files that are still used elsewhere are kept, and attached to a post that uses them. A file counts as used when it is the featured image of another post, when the file or any of its sizes appears in another post's content or excerpt (matched by its path in the uploads folder, so links from before a move to https or a new domain count too), or when it is listed in a classic [gallery] shortcode, an Easy Image Gallery gallery or a WooCommerce product gallery. Every post type counts, including synced patterns, template parts and product variations, and every status except Trash. Uses that only store the file's ID somewhere else, such as custom fields or page builder data, aren't detected: add them with the filter below.
Yes. Add the IDs of the posts that use the file with the dx_dam_attachment_used_in filter, which receives the list of post IDs and the attachment ID: add_filter( 'dx_dam_attachment_used_in', 'my_media_uses', 10, 2 );
Yes. Return false from the dx_dam_delete_post_attachments filter, which receives true and the ID of the post being deleted, and that post's media stays in the library.

Sign In / Register

You need to sign in or register to use this feature.