Docs

Local file removal

3 min readUpdated June 27, 2026

Local file removal deletes the local copies of media files from your server after they have been successfully offloaded to cloud storage. It is disabled by default. When enabled, WP Media Cloud removes the local file immediately after confirming the upload to cloud storage completed successfully.

What local file removal does#

With local file removal enabled, the sequence on every new upload is:

  1. WordPress processes the upload and generates all thumbnail sizes.
  2. WP Media Cloud uploads the original file and all thumbnails to cloud storage.
  3. WP Media Cloud confirms the upload succeeded.
  4. WP Media Cloud deletes the original file and all thumbnails from wp-content/uploads.

If the upload to cloud storage fails at step 3, the local files are kept. WP Media Cloud will not delete a local file unless it has confirmed the cloud upload succeeded.

When the bulk migration tool runs with local file removal enabled, the same logic applies to existing files. Each file is deleted from the server after its cloud upload is confirmed.

When to enable local file removal#

Enable local file removal on production sites where reducing server disk usage is a priority. Once files are in cloud storage, keeping local copies provides no benefit for site visitors since all URLs resolve to the cloud location. Local copies only add to your server’s disk footprint, backup size, and hosting costs.

When to leave local file removal disabled#

There are situations where keeping local copies is the safer choice:

  • Staging environments — if you push a staging database to production, the production site inherits cloud URLs. If local files were deleted on staging and the cloud bucket is not accessible from production, images will break. Keep local files on staging to avoid this.
  • During initial setup — leave local file removal disabled until you have confirmed offloading is working correctly, the connection is stable, and you are satisfied with your storage configuration. It is easier to enable removal once you are confident than to recover deleted files.
  • Sites that switch providers frequently — if you are testing storage providers or regularly migrating between buckets, keeping local copies gives you a fallback if something goes wrong mid-migration.
  • Sites with very large files — video files and other large assets are difficult to re-download from cloud storage if something goes wrong. Consider keeping local copies of large files even if you remove images.

Recovering files after local removal#

If local file removal was enabled and you need a local copy of a file, you can download it directly from your cloud storage bucket using your provider’s dashboard or CLI. WP Media Cloud does not provide a built-in tool to re-download files from cloud storage to your server.

If you need to restore your entire local media library from cloud storage, download the contents of your bucket using your provider’s tools and upload them back to wp-content/uploads in the same folder structure.

Local file removal and deactivation#

If you deactivate WP Media Cloud after enabling local file removal, WordPress will revert to generating local file URLs for all attachments. If local files were deleted, those URLs will return 404 errors. Your files are safe in cloud storage but WordPress cannot serve them without WP Media Cloud active.

Before deactivating WP Media Cloud permanently, either re-download your files from cloud storage or use the URL Replace tool to write cloud URLs directly into your database so they persist without the plugin active.

Enabling local file removal#

Go to WP Media Cloud > Settings > Storage and enable the Remove local files after offloading option. Save settings. The setting applies to all new uploads immediately. To remove local copies of files already offloaded, run the bulk migration tool with this setting enabled.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only