2 min read 2 wks ago

Does it support Offloaded Media (S3, Cloud Storage, …) ?

Short answer

Media Cleaner can’t find files that exist only on S3 or another cloud storage and have no entry in your Media Library. It scans your WordPress database and your server’s uploads folder. It never lists the contents of a bucket.

It can still find Media Library entries that nothing on your site uses, even when their files are offloaded.

How it works with offloaded media

Plugins such as WP Offload Media or S3 third party plugins copy your uploads to cloud storage and often remove the local copy. The Media Library entries stay in the database, so Media Cleaner still sees them.

Scan methodWhat it looks atWith offloaded media
Media LibraryAttachments in the databaseWorks. Each entry is checked against your content, whatever storage holds the file.
FilesystemFiles in the local wp-content/uploads folderOnly sees files still on the server. Files that exist only in the bucket are invisible to it.

Limitations

No bucket audit: Files on S3 that have no Media Library entry (“orphans”) can’t be detected or deleted by Media Cleaner.

Filesystem scan is local only: If your offload plugin removes local copies, this method will find little or nothing.

Trash is local: Media Cleaner’s trash lives in your uploads folder on the server. It can’t hold files that exist only in the cloud.

What you can still do

Clean the Media Library.

Run a Media Library scan to find entries your site doesn’t use. When you delete an entry for good, WordPress deletes the attachment, and offload plugins usually remove the cloud copy along with it. Try it on one entry first and confirm the file is gone from the bucket.

Find bucket orphans outside WordPress.

Export the list of files in your bucket (for example with the AWS CLI: aws s3 ls s3://your-bucket/uploads/ --recursive). Compare it with the files your Media Library references. Anything in the bucket that isn’t referenced is an orphan.

Back up first.

Enable versioning on the bucket, or keep a copy, before deleting anything there. Media Cleaner’s trash can’t recover files deleted directly from the cloud.