Title: [BUG] Remove Files From Server
Last modified: February 16, 2020

---

# [BUG] Remove Files From Server

 *  [ovatiq](https://wordpress.org/support/users/ovatiq/)
 * (@ovatiq)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/bug-remove-files-from-server/)
 * Hello,
 * When I upload a file to my media and it’s offloaded to my s3 bucket, WordPress
   as you know creates multiple versions of that image (thumbnail, small, etc) sizes.
 * The plugin deletes all but the last of the resized images every time. For example,
   3 images are created but only the first 2 are deleted and the last one left in
   my local **/uploads** folder.
 * I debugged to see if it’s because the **path **was not generated when `remove_local_files()`
   ran, but that wasn’t the issue.
 * `if ( ! @unlink( $path ) ) {` runs for all 3 images but the last one isn’t removed.
 * What’s going on?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [ovatiq](https://wordpress.org/support/users/ovatiq/)
 * (@ovatiq)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/bug-remove-files-from-server/#post-12443820)
 * I just noticed that many people have this problem from a 10 month old post that
   was never resolved.
 * [https://wordpress.org/support/topic/remove-files-from-server-not-working/](https://wordpress.org/support/topic/remove-files-from-server-not-working/)
 * If I could give a 0/5 stars I would. Outrageous.
 *  Thread Starter [ovatiq](https://wordpress.org/support/users/ovatiq/)
 * (@ovatiq)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/bug-remove-files-from-server/#post-12443841)
 * To anyone that reads this,
 * Use this ALTERNATIVE PLUGIN [https://en-ca.wordpress.org/plugins/ilab-media-tools/](https://en-ca.wordpress.org/plugins/ilab-media-tools/)
 * It does not have any of the problems Offload media has and provides more features.
 * You will also get 25% off if you’re changing from Offload media to this plugin.
 *  Plugin Contributor [ianmjones](https://wordpress.org/support/users/ianmjones/)
 * (@ianmjones)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/bug-remove-files-from-server/#post-12459945)
 * Hey [@ovatiq](https://wordpress.org/support/users/ovatiq/), sorry to hear you
   had problems with WP Offload Media Lite.
 * The issue you linked to seemed to be a very unique to the user problem, we’ve
   never had similar reports other than later on when WP5.3 dropped with massive
   changes to how media is processed. As far as we know the latest version of WP
   Offload Media (Lite) is working well with WP5.3.
 * If anyone else has an issue like described whereby the original file and generated
   thumbnails are successfully offloaded but the last thumbnail isn’t deleted from
   the server, please let us know, this is the first we’ve head of this particular
   problem.
 * Turning on debugging and re-creating the problem would help. So would any information
   about the sample image, such as whether “original_image” was moved aside and 
   a “-scaled” version created, along with what thumbnail sizes were created. E.
   g., the contents of the “_wp_attachment_metadata” postmeta record for the Media
   Library item.
 *  [hayguys0129](https://wordpress.org/support/users/hayguys0129/)
 * (@hayguys0129)
 * [6 years ago](https://wordpress.org/support/topic/bug-remove-files-from-server/#post-12940242)
 * I also encountered the same problem, Remove Files From Server does not work, 
   the image files remain in /upload
    I tried other plugins (Media Cloud), this 
   plugin can correctly delete local files

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[BUG] Remove Files From Server’ is closed to new replies.

 * ![](https://ps.w.org/amazon-s3-and-cloudfront/assets/icon-256x256.jpg?rev=1809890)
 * [WP Offload Media Lite for Amazon S3, DigitalOcean Spaces, and Google Cloud Storage](https://wordpress.org/plugins/amazon-s3-and-cloudfront/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amazon-s3-and-cloudfront/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amazon-s3-and-cloudfront/)
 * [Active Topics](https://wordpress.org/support/plugin/amazon-s3-and-cloudfront/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amazon-s3-and-cloudfront/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amazon-s3-and-cloudfront/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [hayguys0129](https://wordpress.org/support/users/hayguys0129/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/bug-remove-files-from-server/#post-12940242)
 * Status: not resolved