Support » Plugin: Enable Media Replace » Plugin resets the media title after replacing image

  • Resolved GermanKiwi


    Hi Måns, I just discovered that this plugin resets the title of an image when it replaces the image, and I think it shouldn’t do this.

    Eg: I upload a new image, which is called “test-image-1.jpg”. WordPress will assign a title to this new media item, called “test-image-1”. (This is the text which is in the field at the very top of the “Edit Media” page of the image).

    I can then change this title to something meaningful like “My Vacation Photo”, and also add an Alternative Text, Caption, Description etc.

    Then I use your plugin to replace this image with another image. I use the option for “Replace the file, use new file name and update all links”.

    After the image is replaced, the title of the media item is now reset to the name of the file – “test-image-1” or whatever it was. So my nice, friendly title “My Vacation Photo” is gone.

    I think that the plugin shouldn’t do this. It should leave the title alone. After all, the purpose of the plugin is to “replace media”, nothing else, right?! 🙂

    Could you change this behaviour please?


Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Måns Jonasson


    Actually, that is by design. If you choose the option “Replace the file, use new file name and update all links”, EMR will assume you want to completely replace all mentions of the old file. You probably want to use the first option instead, which just replaces the file and leaves all other metadata such as title, filename, etc intact.

    I see – I guess I wouldn’t have assumed that from the description! 🙂 “Replace the file, use new file name and update all links” just tells me that it’s referring to the filename itself – it will use the new filename and update the links in all the pages/posts to use the new filename, but that’s all.

    I feel like it shouldn’t update the media title though, because that’s separate from the filename. I think if someone wanted to use a brand new media title, they would probably just upload a new image to the Media Library with a new title. But EMR is for replacing the image within an existing Media Library entity, and that implies that the entity itself is still the same. That image is still going to be used in the same places on the website, and it will still have the same Alt Text and Description and Caption, so it should therefore still have the same Title as well. If the user wanted a brand new entity which would be used in different places on the website, they would create a new Media Library item – right?

    In addition, EMR doesn’t replace the Alt Text (nor the Description or Caption, right?) so this is another reason why I think it shouldn’t replace the title either. It should only replace the filename itself. There is a valid use-case for me wanting to replace “image_8324.jpg” with something meaningful like “header-logo.jpg” if one is a direct replacement for the other (maybe even as a way of just renaming the file), but of course I don’t want to change the other metadata – just the file name. 🙂

    Plugin Author Måns Jonasson


    I see your point. I will have a look over this for the next version and see if I can improve it.

    Super, thanks! 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Plugin resets the media title after replacing image’ is closed to new replies.