View Categories

Enable Media Replace is removing the original files!

Enable Media Replace was designed to easily replace your media files, since this is a functionality that is very demanded. If you notice that your original files are removed when the image is replaced, there are two reasons for that.

There’s no backup functionality

This is an expected behaviour. It may seem obvious, but our little plugin was built to simply replace your files. It does not save the previous image in a backup file.

It does not know if there are “other” originals

Enable Media Replace only sees the images that are present in your Media Library. If some specific image was previously converted or edited, and its original version is kept in a backup in a separate location, Enable Media Replace will not know about that. This can cause all sort of issues, including the removal of the “other” originals, and to illustrate this, see the next example with ShortPixel Image Optimizer.

Example

Imagine the following situation:

  1. You upload a PNG image
  2. Let it optimize with ShortPixel Image Optimizer (SPIO)
  3. At the same time, convert it to JPG with ShortPixel as well.
  4. ShortPixel’s backup folder will contain the original PNG
  5. The Media Library will have the optimized and converted JPG

Since Enable Media Replace doesn’t know that the file was originally a PNG, if you use the option “Just replace the file, the following situation can happen:

  1. You try to replace your file with a new PNG (remember, on WordPress we have a JPG converted from a PNG) with the option “Just replace the file”.
  2. Your new file will still be a JPG, but in reality it is a PNG. That results in a corrupted file.
  3. ShortPixel Image Optimizer removes all backups when the image is replaced, which is intended behaviour. That means the original pre-replacement PNG backup will be removed.
  4. ShortPixel will optimize the file and save as a new backup the corrupted JPG.

The previous situation could’ve been avoided if the option “Replace the file, use new file name and update all links” was used.