How to Replace Images or Media Files on a WordPress

a screenshot of the before and after when you replace images on WordPress

If you find yourself working with a lot of images or other media files in WordPress, chances are good that at some point you’ll need to change a file’s content while still keeping links and image placement the same. The best way we’ve found to do this is with a free plugin called “Enable Media Replace”. In this Quick Guide, we’ll teach you how to install this plugin and use it to replace images that already exists or media files on your WordPress site.

There are a number of different things that could cause you to need to replace images in your media library. Like:

  • Your team linked a media file in a marketing campaign, and you don’t want your flyers with the old URL to break
  • You used some of the files in your WordPress media library and in your themes or plugins and you can’t go alter the instances of those in the code easily
  • Your logo changed, and you just want to make sure that change is reflected everywhere.

Here’s the video explaining how you can change an item in your WordPress media library:

How to Replace Images Without a New Name & Location

  1. From your dashboard, select “Plugins”>”Add New”.
  2. Search for “Enable Media Replace” in the “Add Plugins” search box.(click to enlarge)
  3. When you find the listing for “Enable Media Replace” by Måns Jonasson click “Install Now”.
  4. Click “Activate Plugin”.

    (click to enlarge)

    (click to enlarge)

  5. Open up the file you wish to replace by selecting “Media”>”Library” from the left dashboard menu.

    (click to enlarge)

    (click to enlarge)

  6. Click on the image or other media item you wish to change.
  7. From the page titled “Attachment Details”, scroll down until you find the section on the right side titled “Replace Media”.
  8. Hit the “Upload a New File” button.

    Replacing an image in WordPress

    (click to enlarge)

  9. Click the button titled “choose file” and select the new file you wish to replace your current one.
  10. Choose the appropriate setting for your situation. If you’re uploading a file of the same type as the one you’re replacing, keep the default setting “Just replace the file” selected.
  11. Click “Upload”.
    (click to enlarge)
  12. That’s it! Double check that it appears the way you want it to on yours site, and that a confirmation message appears from WordPress above your new file.

    (click to enlarge)

    (click to enlarge)

Image credit: IBRRC


8 Responses

Comments

  • SUBRATA SARKAR says:

    Followed all steps as described above but no image is getting replaced! What could be the reason?

    1. Do I need to make sure the dimension of my new image file exactly matches the old one?

    2. Do I need to make sure the file extension of new image file must be the same
    as of the old one?

    3. I don’t see any permission issue as old images got uploaded from CPT forms in front end.

    4. I am using a independent custom theme built from scratch. There is no parent theme associated. I am almost certain this cannot be an issue but just mentioning in case there is any relation.

    5. OS: Ubuntu 14.04 LTS. WordPress version: 4.7.2

    Am I missing something?!

    • Fred Meyer Fred Meyer says:

      Hi Subrata,

      My best guess would be caching: You’re still seeing a cached version of the image rather than the new image.

      What hosting are you on, and do you have any caching plugins running?

      Fred

  • Ian Malik says:

    After spending hours trying to figure out how to replace an image, your solution was simple, effective and very much appreciated….. THANK YOU!!

  • Cecilia says:

    Before I read this article, I deleted the old file and tried to re-upload a new one with the same file name. I found it doesn’t work and then I download mentioned plugin and re-do the steps. Actually, I want to replace a pdf file. What can I do?

    P.S. I tried to use different browsers to check if I succeed and even delete cache
    Thanks for your help.

  • Rukhsar says:

    is it necessary that same image size will b replaced others are not?

  • Dieter says:

    I loved this plug-in, but it stopped working recently

  • Brian says:

    Doesn’t seem to do anything, cache was cleared . . . back to renaming files when they need to be updated, at least it is consistent.

Pingbacks

Add a Comment

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