Delete Post with Attachments
View on WordPress.orgScores higher than 8% of indexed plugins
About
A simple plugin to delete attached media files e.g. images/videos/documents, when the post is deleted. Supports Elementor, Divi Builder, Thrive Archit …
What It Does
This plugin automatically deletes any media files attached to a post when that post is trashed or permanently deleted, helping site owners avoid orphaned images, videos, and documents in the Media Library. It includes compatibility with major page builders like Elementor, Divi Builder, and Thrive Architect so that files referenced through those builders get cleaned up too. In short, it ties the lifetime of your uploaded media to the lifetime of the content that uses it.
Who It's For
This is a good fit for sites that publish large volumes of content with many unique images per post, such as photography portfolios, news outlets, real estate agencies, and media-heavy blogs that regularly retire old posts. Admins who prefer a tidy Media Library and want to cut down on unused files cluttering their hosting will appreciate the set-and-forget cleanup behaviour. Teams running multi-author publishing operations will also benefit, since frequent content turnover tends to leave the most orphaned media behind.
Who Should Skip It
If your media library is used across many posts and pages as reusable assets, or you rely on files for landing pages, widgets, or external links, this plugin is risky because the deletion is automated. Sites with strict media retention requirements, such as legal documentation archives or e-commerce product image libraries, should also steer clear.
The Bottom Line
Delete Post with Attachments does a narrow job and does it competently, which is reflected in its 62.99 overall quality score that is held back by a small user base and an untested support track. It is a sensible, lightweight choice for publishers who want their media library to mirror their active content, but the lack of any public support history means you should test it carefully on a staging site first and keep backups. Anyone running a site where media has value beyond the post that originally used it should look elsewhere.
Related Plugins
Pick Safe SVG instead if your real problem is allowing SVG uploads safely, not cleaning up media on post deletion, since it solves a completely different concern at scale.
Choose Post Duplicator when you want to clone posts (and optionally their attached media) rather than purge media when posts are removed.
Go with Post Type Switcher if you need to convert existing posts into other post types, which can be a complementary workflow to attachment cleanup.
FileBird is the right alternative if your Media Library is unmanageable due to volume and you need folders and organisation instead of bulk deletion tied to posts.
Consider Header and Footer Scripts only if your housekeeping issue is really about injecting custom code site-wide, not about media lifecycle management.