Description
CrushEdge Orphaned Upload Cleaner is a lightweight, high-performance maintenance plugin designed to detect and clean up orphaned files inside your wp-content/uploads/ directory.
What is an “Orphaned Upload”?
In WordPress, an orphaned upload is a physical file present in your uploads directory that has no matching attachment record in the WordPress Media Library (wp_posts), nor is it a registered thumbnail/sub-size of an active attachment.
These “ghost files” accumulate over time from:
* Interrupted or cancelled media uploads.
* Deleted Media Library items where PHP unlinking failed or was skipped.
* Leftover files from uninstalled plugins, test imports, or manual FTP transfers.
* Old resized thumbnails left behind after themes or plugins change thumbnail dimensions.
Key Features
- Trash Can Safety Quarantine: Default “Move to Trash” action safely isolates orphaned files inside a protected directory (
.crushedge-trash/) with web access lockdown (.htaccessandweb.config), completely eliminating accidental data loss. - 1-Click Single & Bulk Restore: Restore any file, selected files, or all files back to their original locations in
uploads/with a single click. - Empty Trash & Permanent Purge: Safely purge individual files, selected items, or empty the entire Trash Can when ready.
- WordPress-Style Row Actions: Clean hover action links under filenames (
Move to Trash | Delete Permanently | Ignore Folderfor active files;Restore | Delete Foreverin Trash Can), keeping the primary action button column compact and uncluttered. - Sticky Table Headers: Table headers remain pinned to the top of the viewport (
position: sticky; top: 32pxdesktop /46pxmobile) when scrolling through long lists (20–200 items), with automatic WordPress admin bar offset compensation. - 1-Click “Copy Path” Badges: Clickable relative path badges (
uploads/...) with instant clipboard copy, animated checkmark feedback, and floating toast notifications. - In-App Confirmation Dialogs: Clean, responsive confirmation modals with file previews and metadata replacing browser alert popups.
- Lightbox Image Preview: Click any image thumbnail to inspect high-resolution images in an inline modal without leaving the page.
- “Only Orphan” Default: Automatically displays only orphaned uploads on load, with a single-click toggle to inspect all files in the uploads folder.
- Smart Image Derivative Resolution: Intelligently recognizes auto-generated thumbnails (
-150x150,-300x200), scaled images (-scaled), edits (-e123...), and modern Next-Gen companion files (.webp,.avif). If the parent image is in the Media Library, derivative files are automatically linked and protected from deletion. - Expanded Plugin Whitelist: Automatically shields 3rd-party plugin storage folders from being treated as orphans, including WordPress Download Manager (
download-manager-files,wpdm-files), WooCommerce (woocommerce_uploads,wc-logs), Elementor, form uploads (Gravity Forms, WPForms, Fluent Forms, Formidable, Ninja Forms), backups (UpdraftPlus, Duplicator, All-in-One WP Migration), and caching systems. - User-Configurable Excluded Folders & Patterns: Add custom folder names (e.g.,
my-custom-folder) or wildcard patterns (e.g.,*.zip) to exclusions. - “Ignore Folder” Quick Action: Quickly ignore any folder right from the table row with date-structure warning protections.
- Deep Scan Content Reference Checker: Cross-references published post and page HTML content to ensure files actively embedded on your site are locked and protected.
- Developer Hooks: Fully extensible with
crushedge_orphan_protected_dirs,crushedge_orphan_protected_files, andcrushedge_orphan_is_file_protectedfilters. - Instant Sorting: Sort by File Name, Size, Modified Date, and Orphan Status (Ascending & Descending).
- Chunked Mass Actions: Processes mass move-to-trash, restore, and deletions in rapid asynchronous batches with live progress indicators.
- Instant Cancel Support: Easily stop batch processing at any time with instant abort.
- Live Search & Pagination: Real-time search filter and customizable pagination (20, 50, 100, 200 items per page).
- Path Traversal Guard: Strict directory containment verification preventing unauthorized access outside the uploads folder.
- WordPress Plugin Check (PCP) Compliant: Built to the highest WordPress coding and security standards using
WP_Filesystemand corewp_delete_file().
Legal Disclaimer
CRUSHEDGE ORPHANED UPLOAD CLEANER IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, CONTRIBUTORS, OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, LOSS OF DATA, WEBSITE DOWNTIME, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FILE DELETIONS ARE PERMANENT AND IRREVERSIBLE. Always create and verify a complete backup of your WordPress database and wp-content/uploads/ directory before performing any cleanup or deletion operations.
Installation
- Upload the
crushedge-orphaned-upload-cleanerdirectory to your/wp-content/plugins/directory. - Activate the plugin through the ‘Plugins’ menu in WordPress.
- Navigate to Tools CrushEdge Orphaned Upload Cleaner in your WordPress admin menu.
- Review the detected orphan files and perform single or bulk deletion.
FAQ
-
Does this delete images that are used in my posts?
-
CrushEdge Orphaned Upload Cleaner cross-references files on disk against active Media Library attachment records, auto-generated derivative patterns, and includes a Deep Scan toggle to verify if an image is embedded inside published post and page HTML content.
-
How does the plugin handle Download Manager or WooCommerce files?
-
Common third-party directories like
download-manager-files,woocommerce_uploads, form uploads, and page builder assets are whitelisted by default. You can also exclude any custom folder or pattern using the Excluded Folders tool or the Ignore Folder button. -
What about small images and thumbnails generated automatically?
-
The plugin features a smart derivative detection engine that recognizes
{name}-{width}x{height}.{ext}patterns as well as.webpand.avifcompanions. If the parent media item is registered in WordPress, these thumbnails are automatically protected and shielded from the orphan list. -
Can deleted files be recovered?
-
Yes! When you move files to the Trash Can, they are safely quarantined in a hidden directory (
.crushedge-trash/). You can restore individual files, selected batches, or all files back to their exact original upload locations at any time. Only when you explicitly choose Delete Permanently or Empty Trash Can are files permanently deleted from disk. -
What is the Trash Can quarantine feature?
-
The Trash Can acts as an essential safety net against accidental data loss. Instead of immediately erasing files from disk, moving an item to the Trash Can moves the physical file into a quarantined directory (
wp-content/uploads/.crushedge-trash/) with web access blocked via.htaccessandweb.config. This takes the file offline without destroying it, giving you total peace of mind to test your site before permanently purging. -
Are core system files safe?
-
Yes. Critical server and WordPress files such as
.htaccess,index.php,web.config, and plugin cache/style folders are automatically whitelisted and cannot be deleted.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“CrushEdge Orphaned Upload Cleaner” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “CrushEdge Orphaned Upload Cleaner” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.3
- Trash Can Safety Quarantine System: Added full two-stage deletion. Moving files to Trash Can safely isolates them into a protected directory (
wp-content/uploads/.crushedge-trash/) with.htaccess,web.config, andindex.phpsecurity lockdown. - 1-Click Single, Bulk & All Restore: Added ability to restore any single file, multiple selected files, or all files back to their original upload folders with one click.
- Empty Trash & Permanent Purge: Added safe controls to permanently delete individual quarantined files, bulk purge selected items, or empty the entire Trash Can.
- WordPress-Style Row Actions: Converted secondary actions to native hover row actions (
Move to Trash | Delete Permanently | Ignore Folder), providing a cleaner, more streamlined action column. - Sticky Table Headers: Both Files on Disk and Trash Can table headers remain pinned (
position: sticky) with WordPress admin bar offset compensation (top: 32pxdesktop /top: 46pxmobile). - 1-Click Copy Path Badges: Interactive relative path badges with instant clipboard copy, animated checkmark feedback, and toast notifications.
- WordPress Plugin Check (PCP) Compliance: Replaced raw filesystem functions with
WP_Filesystem(move(),delete(),chmod(),rmdir(),get_contents()) and corewp_delete_file(), added explicit/* translators: ... */comments for all placeholder strings, and adopted WordPress 4.6+ automatic translation loading. - Smart Derivative & Sub-Size Resolver: Added heuristic detection for generated image thumbnails (
-150x150,-300x200), scaled images (-scaled), edits (-e123...), and modern WebP/AVIF companions. Files linked to valid Media Library attachments are protected. - Expanded 3rd-Party Whitelist: Added built-in protection for WordPress Download Manager (
download-manager-files,wpdm-files), WooCommerce, Elementor, Gravity Forms, WPForms, Fluent Forms, Formidable, Ninja Forms, and caching/backup directories. - Developer Filters: Added
crushedge_orphan_protected_dirs,crushedge_orphan_protected_files,crushedge_orphan_is_file_protected, andcrushedge_orphan_attached_files_maphooks. - Custom Excluded Folders & Patterns: Added modal and database settings (
crushedge_orphan_excluded_paths) to exclude custom directories and wildcard patterns (*.zip,*.pdf). - “Ignore Folder” Action: Added one-click table row button to instantly ignore and protect any directory.
- Deep Scan Content Reference Check: Added optional toggle to verify if candidate orphan files are actively embedded in published post or page HTML content.
- Legal Disclaimer & Safety Notice: Added prominent safety notice and limitation of liability disclaimer across plugin dashboard and documentation.
- Ko-fi Support: Added Ko-fi donation link and button to support continued free development.
1.2
- Complete internationalization (i18n) across entire admin dashboard, batch deletion modal, and live notifications.
- Added native translations for 10 major languages: Spanish (es_ES), German (de_DE), French (fr_FR), Japanese (ja), Portuguese (pt_BR), Indonesian (id_ID), Italian (it_IT), Dutch (nl_NL), Russian (ru_RU), and Simplified Chinese (zh_CN).
- Added explicit load_plugin_textdomain() initialization for offline and standalone environments.
1.1
- Renamed plugin display name to CrushEdge Orphaned Upload Cleaner and slug to crushedge-orphaned-upload-cleaner.
- Updated donation link and directory metadata.
1.0
- Initial public release.
- Interactive table with sorting by name, size, date, and orphan status.
- “Only Orphan” toggle filter enabled by default.
- Viewport-fixed progress modal with chunked batch processing and instant abort support.
- Nonce verification, permission checks, and path traversal protection.
