Every now and then I mistakenly hit upload on the wrong image whilst crafting a post. Annoyingly, I then have to upload the correct version of the image, which automatically gets assigned a new identifier instead of giving me the option of just simply replacing the file I just mistakenly uploaded.

WordPress doesn’t have a native way of doing this, but that of course then opens the door for the rest of us developers, and so Mans Jonasson stepped up and crafted the nifty Enable Media Replace WordPress plugin.

As the description says, “This plugin allows you to replace a file in your media library by uploading a new file in its place. No more deleting, renaming and re-uploading files!”

It has two replace options, namely:

  • Just replace the file. This option requires you to upload a file of the same type as the one you are replacing. The name of the attachment will stay the same no matter what the file you upload is called.
  • Replace the file, use new file name and update all links. If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file will be updated to point to the new file name.

Easy to use, rather powerful, it does exactly what I need it to do. Still, it would be nice if someone over at WordPress could just incorporate this functionality into the native interface…

enable media replace wordpress plugin

horizontal wordpress logo landscape

Related Link: https://wordpress.org/plugins/enable-media-replace/