Support » Plugin: Media Library Assistant » Stop MLA from renaming my files

  • Resolved Donald Jenkins


    I go to great trouble to name the files I upload to the Media Library using certain conventions, which help me search for them, and also means I can immediately know, just from the file name in, say, a URL, most of the information about that image (its size, resolution, topic, etc.)

    I’ve recently started using MLA to tag my existing images and sort them into categories. I noticed a while later, to my dismay, that whenever I have done this, MLA has also been quietly renaming all my image files to match their title. This has completely broken my system.

    Manually renaming the files back to the original names won’t be fun, but it’s just doable. But how can I stop MLA renaming files in the background? I haven’t been able to find the setting for this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author David Lingren


    Thank you for your question and the details behind it. Just to be clear, is your issue with the actual file name or with the Media Library item Title?

    As far as I know, MLA has no feature or internal code that alters the actual name of the file attached to a Media Library item in any way. This was a deliberate design choice going back to the first MLA version and I have declined a few requests to add such features over the years.

    There are several ways to upload files to WordPress. If you can give me more details on the steps you take to upload files I will investigate further. If you can provide a link to one of your files (tell me the original file name you specified if it has been changed) I can try testing it on my own system.

    WordPress does have a bit of code that might alter the file name, but not in the way you describe. In file \wp-includes\functions.php, function wp_unique_filename() creates “a filename that is sanitized and unique for the given directory”.

    WordPress does contain code to generate item Title, Caption (excerpt) and Description (content) values. In file \wp-admin\includes\image.php, function wp_read_image_metadata() gets extended image metadata, exif or iptc as available. In file \wp-admin\includes\media.php, functions media_handle_upload() and media_handle_sideload() create the item Title, Caption and Description from the image metadata, if present, or the file name.

    All of the WordPress functions have many “hooks” (actions and filters) that plugins and themes can use to change the default logic. Again, MLA does not use these hooks to alter the actual file name. MLA does use some of them to change values such as Title and Caption if and only if you define and activate a mapping rule in the Settings/Media Library Assistant IPTC/EXIF tab. You can go to that tab to see if a rule is active or to completely disable the mapping functions.

    If you can give me more information and an example file I will try to reproduce your issue on my system. If there’s an MLA problem I will fix it as soon as possible. I will leave this topic unresolved until I hear back from you.

    I’m feeling very guilty abut this because it turns out the issue wasn’t caused by MLA at all in the first place. It was another plugin I had installed, Media File Renamer. I’ve been working overtime on this website for the past few days and it has rather washed me out. I now feel rather silly having opened this topic, but the upside of it is with your very detailed explanation of how MLA handles this topic, I know how to handle it properly in the future.

    Hey, sh^t happens! I find Mr Lindgren’s stuff to be quite well thought out, it’s the overwhelming amount of functionality that I usually fail to understand. I think I’ve barely scratched the surface, myself. I only found 1 actual bug, which was quite subtle, all other errors have been operator errors on my part. Plus, his support is surreal (I mean that in a good way!)

    Plugin Author David Lingren


    Thanks for your update with the good news that you’ve found the cause of your issue and that MLA was not contributing to it. I can certainly understand how pressing deadlines and multiple plugins can be stressful.

    I will leave this topic resolved, but please start a new topic if there’s anything I can do to make your MLA experience a good one. Thanks for your interest in the plugin.

    @wesm – thanks for adding your positive feedback!

    All I can say is the world would be a better place if all WordPress plugins were like MLA, with bugs that turned out to be non-existent, and prompt, seriously well-informed support. Impressive.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Stop MLA from renaming my files’ is closed to new replies.