How to Use the Enable Media Replace Plugin

It can be a complicated process to replace images and media files in WordPress. The Enable Media Replace plugin enables you to quickly upload replacement images.

What is complex about the default process? For example, if you want to replace an image in a WordPress post, you have to do the following:

  • Access the Media Library.
  • Delete the old image.
  • Upload a new image
  • Edit the post.
  • Link the image to the post again.

This process is tolerable if you just need to replace one media file, but it gets cumbersome if you need to replace several media assets.

The Enable Media Replace plugin for WordPress allows you replace media files with just two clicks.

Keep reading to learn how to use this plugin!


The default WordPress option for replacing images

Let’s suppose you have written and published a post with a featured image.

A WordPress post with a featured image
  • Edit the post and replace the featured image.

You will probably have to upload a new image or choose a new one from the media library. I uploaded another image with the same name. However, WordPress will change the file name, in order to prevent inconsistencies and redundancies in the database.

Replacing an image in WordPress

The image gets updated. But what if you have the same image across multiple posts? You would have to replace it on each one of them. Maybe you did want to preserve the new file instead of both of them. That is what the Enable Media Replace plugin is useful for, let’s take a look at it!


Step #1. Install the Enable Media Replace Plugin

Let's add the plugin to our sites:

  • Click Plugins > Add new.
  • Search for the Enable Media Replace plugin.
  • Click Install Now.
  • Click Activate.
Install the Enable Media Replace plugin

Step #2. Use the Enable Media Replace options

Let's see how this plugin works and replace an existing image:

  • Click Media > Library.
  • Select the image you want to replace.
  • You will notice a new option at the bottom of the interface: Replace media.
  • Click Upload a new file.
  • Now click the Browse button to upload a new file. 
  • Click Replace the file, use new file name and update all links.
  • Under the Date Options select Keep the date
  • Click Upload.
Replacing an image with the Enable Media Replace plugin
  • Click Media to check the Media Library.

You will see that the old image is no longer available and the new image has kept the original file name. Furthermore, the image has been replaced in the post.

Successfully replacing an image with the Enable Media Replace plugin

You can replace other types of media files, like videos.

Replacing media files with the Enable Media Replace plugin

Step #3. Using the the Enable Media Replace Shortcode

If you want to keep a record of the media assets you have replaced in your site, you can use a shortcode for your future reference.

  • Click Media.
  • Select the image you have just replaced.
  • Check the image ID on the URL.
Finding the ID of an image with the Enable Media Replace plugin
  • Click Posts > Add new.
  • Add this shortcode [file_modified id=XX], where XX is the ID of your image.
  • Click Publish twice.
Using the Enable Media Replace plugin shortcodes

You can make this post private since this information concerns only the administrator of the site. If you need some background, this post has more details on private posts.

A shortcode in action with the Enable Media Replace plugin

I hope you liked this tutorial. Thanks for reading PublishPress!

If you want to more control, check out our tutorial on who can delete images in WordPress.

Authors

  • Jorge Montoya

    Jorge lived in Ecuador and Germany. Now he is back in his homeland of Colombia. He spends his time translating from English and German to Spanish. He loves to learn about open source technology.

  • Steve Burge

    Steve is the founder of PublishPress. He's been working with open source software for over 20 years. Originally from the UK, he now lives in Sarasota in the USA. This profile is generated by the PublishPress Authors plugin.

2 Comments

  1. there is also a plugin called WXY Tools Media Replace that is easier to use and works anywhere you can upload an attachment. It also preserves any alternate text, descriptions, or categories for attachments. Hope this is helpful.

Leave a Reply

Your email address will not be published. Required fields are marked *