Mirror deletion
Mirror deletion removes files from cloud storage when they are deleted from the WordPress media library. It keeps your storage bucket in sync with your media library so files you no longer need in WordPress are not left sitting in cloud storage indefinitely.
How mirror deletion works#
When a file is deleted from the WordPress media library, either through Media > Library or programmatically via wp_delete_attachment(), WP Media Cloud sends a delete request to your cloud storage provider for the corresponding file and all its thumbnail sizes. If the delete request succeeds, the files are permanently removed from the bucket.
Mirror deletion is permanent. There is no recycle bin in cloud storage. Once a file is deleted from the bucket it cannot be recovered through WP Media Cloud or through the WordPress media library. Depending on your storage provider, recovery may be possible through versioning features in the provider’s own dashboard, but WP Media Cloud does not enable or manage provider-level versioning.
When to enable mirror deletion#
Enable mirror deletion when you want your cloud storage bucket to stay in sync with your WordPress media library. Any file you delete in WordPress is also removed from the bucket, keeping your storage usage accurate and avoiding accumulation of orphaned files over time.
Mirror deletion is appropriate for most production sites where media management is straightforward and deleted files are genuinely no longer needed.
When to leave mirror deletion disabled#
There are situations where keeping files in cloud storage after deleting them from WordPress is the right choice:
- Files shared across multiple sites — if two or more WordPress installations point to the same cloud storage bucket, deleting a file on one site will remove it for both. Disable mirror deletion in this scenario or ensure each site uses a separate path prefix within the shared bucket.
- Staging and production sharing a bucket — deleting a file on a staging site will permanently remove it from the bucket, breaking the same file on production. Always disable mirror deletion on staging sites that share a bucket with production.
- Regulatory or compliance requirements — some organisations are required to retain media files for a defined period regardless of whether they are actively used. Mirror deletion cannot be selectively applied per file type, so disable it entirely if retention requirements apply.
- Sites where deleted media may need to be restored — if there is any possibility you may need to reinstate a deleted image or document, keep mirror deletion disabled and manage bucket cleanup manually.
Mirror deletion and local file removal#
Mirror deletion and local file removal are independent settings. Enabling both means that when a file is deleted from the WordPress media library, both the local server copy (if it exists) and the cloud storage copy are permanently removed. Disabling local file removal but enabling mirror deletion means the cloud copy is deleted but any local copy remains on the server.
Enabling mirror deletion#
Go to WP Media Cloud > Settings > Storage and enable the Delete from cloud storage when deleted from media library option. Save settings. The setting applies immediately to all subsequent deletions.