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.
- 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.
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.
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.
- 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.
You can replace other types of media files, like videos.
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.
- Click Posts > Add new.
- Add this shortcode [file_modified id=XX], where XX is the ID of your image.
- Click Publish twice.
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.