Projects

Media File Renamer

Developed in 2012 using PHP and the WordPress API.

This WordPress plugin allows you to rename physically the media files by changing their titles, and it will also update theirs references in the posts automatically (cleaner files + better SEO). I tried to use a plugin called rename-media (0.1) in the past, but it wasn’t working properly on IIS and Windows. Also, it wasn’t updating the links in the posts, and was crashing (on Linux) when I tried to use fancy titles. That’s why I decided to create my own (if you wondered :p).

Download

Screenshots

Media File Renamer

It’s a very similar screenshot to the one from rename-media (0.1).
  • http://www.onlinepharmacyhub.com/Buy-Generic-Levitra-Verdenafil-hcl_p_162.html Buy Generic levitra

    Media File Renamer Stopped working after migrating to different server (3 posts). Sjourney Member Posted

    • http://www.totorotimes.com/ Jordy Meow • Japan & Urbex

      What kind of server is it? Network installation of WordPress? I need details

  • http://www.facebook.com/tomas.berner Tomas Berner

    Hi Jordy! I have previously installed your plugin (Media File Renamer) and it have been working perfectly until today. I’m running wordpress 3.4.1 and from this morning i have to go to “Media->Rename files” and rename flagged media by clicking the button. I’m pretty sure i didn’t have to do that yesterday Any ideas? Since yesterday i have updated 2 other plugins but it didn’t help to deactivate them…

    • http://www.totorotimes.com/ Jordy Meow • Japan & Urbex

      Hello Tomas! Actually it is probably normal, it depends on the way you updated those media names. Did you recently try to change the titles of media while you were editing a post? If it is the case, yes, the media will be flagged and can only be renamed “later”. This is to avoid any troubles

      • http://www.facebook.com/tomas.berner Tomas Berner

        Thank you for your quick response! I think i understand what you mean. But didn’t the plugin automatically rename filenames on upload? Or have i totally lost my mind? Every time i upload an image to a post, i now have to go to “Media->Rename files”. It doesn’t matter what i write in the description or title field.

        • http://www.totorotimes.com/ Jordy Meow • Japan & Urbex

          Oh, sorry, I actually understand now! You upload the image when you’re editing the post, and before there were renamed automatically in the past, you are right!

          The issue I had recently (and a lot of people ran away because of that issue) is that when one is trying to modify the title of an image while editing a post (after the upload, and when the image has been already inserted), it was crashing the post… that’s why I did all that to avoid this issue.

          Give me one day (actually one night sleep + one part of my morning) and I will try to find a way to make it work

          • http://www.facebook.com/tomas.berner Tomas Berner

            Wow! You da man!

          • http://www.totorotimes.com/ Jordy Meow • Japan & Urbex

            Sorry for the delay, I checked and rechecked the code and if I want to do it properly (which is by avoiding to break the posts and links) I cannot do it this way. You can only rename directly when you are in the Media Library, not while editing the post.

            I found a tricky way of doing it though, but each time you change the title it would have to check the related posts (in case you are using such a plugin as WPML) and then will have to inject some Javascript everytime in order to rename the modified filename already in the HTML code. It is a bit violent, and depending on how WordPress is evolving it might stop working and break everything…

            There is again “another” way. I could add an option “Safe mode”, checked by default. If you uncheck this option, the plugin would behave like before… and in that case I could even include my “tricky way”! What do you think about it? Might be a good solution.

  • Sam Brady

    Hi I uploaded the file renamer plugin. Did rename all files, and now majority of file names are empty??? Is another plugin blocking it. I have title, alt text, caption and description filled out. I upload my pictures to other sites such as Facebook and now I have the ‘no picture’ symbol. http://www.a-gentlemans-row.com

    • http://www.totorotimes.com/ Jordy Meow • Japan & Urbex

      Hey Sam. I checked your website and the photos are all showing. What do you mean the filenames are empty? What is the relationship with Facebook and all?

      • William

        I may be having a similar issue and am uploading a screen capture. I grabbed this image right after the media update. You can see at the bottom that the URL was changed to the title. At the top, where is says “File Name,” it’s now blank.

        • http://www.totorotimes.com/ Jordy Meow • Japan & Urbex

          Hello @f9edd82c9bd4ee9a00e6bb1691c6cfe3:disqus and @70a9dc577f40d02ad79eaeb33771c574:disqus ! This was indeed a bug, and I got it fixed in the new release. Please try it And thanks a lot for your messages.

        • http://www.totorotimes.com/ Jordy Meow • Japan & Urbex

          Hello @f9edd82c9bd4ee9a00e6bb1691c6cfe3:disqus and @70a9dc577f40d02ad79eaeb33771c574:disqus ! This was indeed a bug, and I got it fixed in the new release. Please try it And thanks a lot for your messages.

        • http://www.totorotimes.com/ Jordy Meow • Japan & Urbex

          Hello William and Sam! This was indeed a bug, and I got it fixed in the new release. Please try it And thanks a lot for your messages.

          • William

            Thanks so much, glad the screen shot could help. Your plugin saved me a lot of tedious work.

          • http://www.totorotimes.com/ Jordy Meow • Japan & Urbex

            Thanks a lot, I am glad it works! Please rate it if you really like it that would help me as well :p Have a nice day and look for more nice updates

          • http://twitter.com/natedriver Nathan Driver

            getting the same thing where images are missing now

  • Guest

    images are now gone

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      This is not a very helpful comment for all the work I put in that plugin. Please provide more information or contact me directly and we’ll track the bug together.

  • http://twitter.com/natedriver Nathan Driver

    images are now gone

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      Sorry for that issue, I never encountered it myself. Please contact me directly, we’ll find the bug together and I’ll release a patch. Thanks.

  • mark

    At my Blog (WP 3.4.2) this Plugin will delete the Servername and path from the database. After Renameing i have a guid like http://picture.jpg !!

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      Hey Mark. Sorry for the bug, it seems the plugin doesn’t work with one case (maybe another plugin, or a special configuration), so we should track this bug down. Can you contact me directly? We’ll find the bug and I’ll release a patch ASAP. Thank you!

      • bill

        i am having this exact same issue, it has really meesed up my image site map, how can i recover from this?

        • http://www.totorotimes.com/ Jordy Meow • Totoro Times

          Mmm, I have no idea how to help you, but before to use the plugin the first time I wrote everywhere that you should do a backup. But since Mark had an issue and I did a new release, nobody ever had that issue, so it will be very hard to help you. If you can tell me how to reproduce the bug on a clean version of WordPress, I will definitely help.

          • bill

            i have managed to correct manually using an update script i wrote to restore the GUID value in wp_posts.

            but have decided to disable this plugin for now, not sure i can set up a clean version of wordpress for you to have a look

            thanks anyway

  • http://www.facebook.com/benny.powers Ben Powers

    Plugin changes letter case, breaks links.

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      Do you have an example? How can I reproduce this problem? The plugin changes the filenames and all, so letter case is of course part of it as well.

  • adam

    Really great app that saved me a ton of time. One dumb question. I could not figure out how to rename a select group of images. How do I do that?

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      We cannot for now, unfortunately… we can either go one by one, or we can do everything. Selecting a group of media is not yet part of WordPress API and requires some “hacking”, which I absolutely want to avoid. So yeah, this feature will come, as soon as the WordPress API evolves on this point (and pretty sure it will).

  • Chris

    Hi I went to install your plugin today on a clients site, and got the following error: Warning: Missing argument 2 for wpdb::prepare(), called in /public_html/wp-content/plugins/media-file-renamer/media-file-renamer.php
    on line 157 and defined in /public_html/wp-includes/wp-db.php on line 990 I have found a link for developer that explains about the problem, but i cant fix it on my end, here is the url http://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      Are you sure you installed the last version? Those warnings has been removed in the last version of the plugin.

  • Seb

    Hello, firstly I would like to say I love your plugin, also I was wondering if there is a way to use so it renames the permalink as well as the url using the title because all my permalinks are IMG_101, IMG_102 and only the URL gets renamed, thanks

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      Hey Seb, actually there is an option for that. Settings -> File Renamer -> Rename Slug.

      • R

        Where is the Settings option? Is it the main settings for WP?

  • Tommy

    Hi Jordy,

    Can I somehow grab the attachment post title and substitute the media name with this one by modifying your plugin?

  • Penny

    Hi Jordy, your plugin works great – thanks! Just wanted to point out though that it also changed the name of my header and background graphics without changing the name in the settings. It’s not a big deal – and was easily fixed – but I just wanted to let you know (if you weren’t already aware )

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      Hey Penny! Yes, there is a little issue with the current version of the plugin. I actually worked on it and I am about to release a new version, tomorrow or sometimes this week-end! I am still testing it to make sure it is perfect but it is far better than the one you have, I am pretty sure! Thank you for your comment and don’t forget to rate the plugin if you like it http://wordpress.org/support/view/plugin-reviews/media-file-renamer

  • PFF

    Hi, a have installed MFR, and at the second I activate it, I got a “fatal error” with this message : “Parse error: syntax error, unexpected ‘else’ (T_ELSE) in C: (…) wp-contentpluginsmedia-file-renamermedia-file-renamer.php on line 303″

    My WP version is 3.5.1 french.
    I hope you – or somebody else – will help me…

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      Hey PFF! Yes, and you are not the first one you uncounted that issue. I still don’t know WHY it happens (PHP version? PHP settings?), but I know how to resolve it

      I updated the current version of the plugin. Can you uninstall it from your WordPress and re-install it again? Tell me if it works this time

      • Robert Farkle

        I think the problem is that you are mixing < ? and < ?php for your tags. I converted to just the < ? notation and the problem went away.

        • http://www.totorotimes.com/ Jordy Meow • Totoro Times

          Yes I know I repaired it a few days ago but it’s not released yet Thank you!

          • Robert Farkle

            Awesome. Just helping out. I failed to mention a great big THANK YOU for the plugin. I think this is one of my new favorites. I look forward to its future.

          • http://www.totorotimes.com/ Jordy Meow • Totoro Times

            I am glad to hear that! The early versions of the plugin were a bit buggy but I got the plugin back on track a few weeks ago, now I am very happy with it (I still need to improve the dashboard, in the same way I did for my other plugins). Would you mind rating it by the way? That would be awesome

          • Robert Farkle

            I’ll even top that and donate $5.

          • http://www.totorotimes.com/ Jordy Meow • Totoro Times

            Thanks a lot Robert! You just offered me 16 cups of coffee at the vending machine I have next to me

  • http://www.facebook.com/arnaudsaintpaul Arnaud Saint-Paul

    Hi Jordy,

    Thank you so much for this plugin. It is VERY useful!

    Since i installed the new version I used the ‘Scann all issues’ option and it came up with a few issues where the plugin was not able to rename a few images because it found same names.
    So I tried to change the title and it did work with some images and some others got the following error:

    Warning: rename(/home/tapuat/public_html/wp-content/blogs.dir/4/files/2011/06/DSC_4719-Edit.jpg,/home/tapuat/public_html/wp-content/blogs.dir/4/files/2011/06/roxana-jones-inspirational-author.jpg) [function.rename]: No such file or directory in /home/tapuat/public_html/wp-content/plugins/media-file-renamer/media-file-renamer.php on line 456

    Fatal error: 0 in /home/tapuat/public_html/wp-content/plugins/media-file-renamer/media-file-renamer.php on line 457

    Any idea where it can come from?

    Thanks

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      Strange, did you check if the files already exists? For instance, this one: “/home/tapuat/public_html/wp-content/blogs.dir/4/files/2011/06/DSC_4719-Edit.jpg”?

  • cymbal cymbal

    Thanks for the plug in..

    but this plug in not update attachment “post_name” in database. for example if i upload a photos abcd123.jpg and then rename it newyork.jpg and attach with a post it gives permalink of http://mywebsite.com/post-name/abcd123/ instead of http://mywebsite.com/post-name/newyork/

    all i find that it doesn’t update database post_name according to post_title

    if I run this little php then all images post_name update instantly but problem is it update all….

    ‘ASC’,

    ‘post_type’ => ‘attachment’,

    ‘post_status’ => null,

    ‘numberposts’ => -1,

    );

    $allposts = get_posts($arr);

    if ($allposts) {

    foreach ($allposts as $thepost) {

    $thepost->post_name = ”;

    wp_update_post( $thepost ); // Update the post into the database

    echo $thepost->post_name;

    }

    }

    so it would be nice and extremely helpful if you anyhow include this little function in your plug in…

    thanks once again for this useful plugin

  • Guest

    Thanks for the plug in..

    but this plug in not update attachment “post_name” in database. for example if i upload a photos abcd123.jpg and then rename it newyork.jpg and attach with a post it gives permalink of mywebsite(.)com/post-name/abcd123/ instead of mywebsite(.)com/post-name/newyork/

    all i find that it doesn’t update database post_name according to post_title

    if I run this little php then all images post_name update instantly but problem is it update all….

    ‘ASC’,

    ‘post_type’ => ‘attachment’,

    ‘post_status’ => null,

    ‘numberposts’ => -1,

    );

    $allposts = get_posts($arr);

    if ($allposts) {

    foreach ($allposts as $thepost) {

    $thepost->post_name = ”;

    wp_update_post( $thepost ); // Update the post into the database

    echo $thepost->post_name;

    }

    }

    so it would be nice and extremely helpful if you anyhow include this little function in your plug in…

    thanks once again for this useful plugin

  • cymbal cymbal

    Thanks for the plug in..

    but this plug in not update attachment “post_name” in database. for example if i upload a photos abcd123.jpg and then rename it newyork.jpg and attach with a post it gives permalink of mywebsite(.)com/post-name/abcd123/ instead of mywebsite(.)com/post-name/newyork/

    all i find that it doesn’t update database post_name according to post_title

    if I run this little php then all images post_name update instantly but problem is it update all….

    require( ‘wp-load.php’ );

    set_time_limit(20000);

    $arr = array(

    ‘order’ => ‘ASC’,

    ‘post_type’ => ‘attachment’,

    ‘post_status’ => null,

    ‘numberposts’ => -1,

    );

    $allposts = get_posts($arr);

    if ($allposts) {

    foreach ($allposts as $thepost) {

    $thepost->post_name = ”;

    wp_update_post( $thepost ); // Update the post into the database

    echo $thepost->post_name;

    }

    }

    so it would be nice and extremely helpful if you anyhow include this little function in your plug in…

    thanks once again for this useful plugin

  • stupid cymbal

    I am extremely sorry that I didn’t notice slug option….

    please delete all my 3 comments…..

    extremely sorry……

    Thanks for this plugin

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      Haha, no problem. Not everybody notices at first, maybe I should write something somewhere. Would you mind give the plugin a rating? That would be great, I need good ratings since I got a few bad ones a long time ago. Here: http://wordpress.org/support/view/plugin-reviews/media-file-renamer. Thanks a lot I will delete the 3 comments, no worries

  • Glass Man

    Howdy,

    LOVE this plugin, but am not sure if I’m using it properly. It changes the name of the file after I edit the title, but not the permalink, and when I visit posts where the “renamed” files are, it is the old file without being updated or renamed. Here is a screenshot

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      Did you check the settings for the plugin? There is an option to rename the slug.

  • http://twitter.com/iChaitanya Chaitanya Purandare

    Hi, I think I’ve found a bug. I’m running Media File Renamer v1.3.4 on WordPress 3.5.2

    Now, the file and the slug are being renamed when I update the title of the attachment, but the value of the “File name:” field doesn’t change even after hitting the “Update” button. I think this is a bug. Media in this case is a 50 MB mp3 file.

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      Can you please post this on the WordPress forums?

      • http://twitter.com/iChaitanya Chaitanya Purandare

        I fixed it by manually editing the relevant DB row. Most probably this happened due the use of an unusual character in the media file’s name.

  • Denis

    Hi,
    how can I use this plugin for german letters like ü,ö,ä,ß I need to change them to ue,oe,ae,ss
    Is there a way to do this?
    Cheers,
    Denis

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      Please look forward to the next version of the plugin. It will be out at the same time as the new WordPress release.

  • blendmarketing

    Hello,

    Once a file has been re-named, the name change is not being reflected in the permalink. Is there a way to have the permalink change as well?

    Many thanks.

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      Maybe you should check the options

  • Antonio

    Where can i find the settings for this plugin?

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      In WordPress Admin, Settings menu…

  • Claus

    Hi Jordy

    The plugin is great, but I ran into a small issue:
    After renaming the images files (rename button) I can no longer add them as a featured image to a post (post_thumbnail).
    On the “edit post” page the images does show up, but on the actual website the link to the image thumbnail does not relect the name change:

    old image thumbnail name: IMG_5399b-150×150.jpg
    new (renamed) image thumbnail name: kuehlerreparatur-auf-kirgisisch-kirgistan-150×150.jpg

    Source Code from actual website:

    The image files and thumbnails are renamed but WP still uses its old name. Looks like the file name change did not change in the database…

    Is this a bug, or am I missing something?

    http://www.roadtosomewhere.de

    Thanks,
    Claus

    • Claus

      … found it in wp_postmeta:

      a:6:{s:5:”width”;i:1440;s:6:”height”;i:1080;s:4:”file”;s:50:”2013/12/kirgisische-kuehlerreparatur-kirgistan.jpg”;s:5:”sizes”;a:8:{s:9:”thumbnail”;a:4:{s:4:”file”;s:50:”kirgisische-kuehlerreparatur-kirgistan-150×150.jpg”;s:5:”width”;i:150;s:6:”height”;i:150;s:9:”mime-type”;s:10:”image/jpeg”;}s:6:”medium”;a:4:{s:4:”file”;s:50:”kirgisische-kuehlerreparatur-kirgistan-300×225.jpg”;s:5:”width”;i:300;s:6:”height”;i:225;s:9:”mime-type”;s:10:”image/jpeg”;}s:5:”large”;a:4:{s:4:”file”;s:51:”kirgisische-kuehlerreparatur-kirgistan-1024×768.jpg”;s:5:”width”;i:1024;s:6:”height”;i:768;s:9:”mime-type”;s:10:”image/jpeg”;}s:6:”custom”;a:4:{s:4:”file”;s:21:”IMG_5399b-150×150.jpg”;s:5:”width”;i:150;s:6:”height”;i:150;s:9:”mime-type”;s:10:”image/jpeg”;}s:14:”post-thumbnail”;a:4:{s:4:”file”;s:53:”kuehlerreparatur-auf-kirgisisch-kirgistan-150×112.jpg”;s:5:”width”;i:150;s:6:”height”;i:112;s:9:”mime-type”;s:10:”image/jpeg”;}s:6:”header”;a:4:{s:4:”file”;s:54:”kuehlerreparatur-auf-kirgisisch-kirgistan-1330×180.jpg”;s:5:”width”;i:1330;s:6:”height”;i:180;s:9:”mime-type”;s:10:”image/jpeg”;}s:6:”slider”;a:4:{s:4:”file”;s:53:”kuehlerreparatur-auf-kirgisisch-kirgistan-800×250.jpg”;s:5:”width”;i:800;s:6:”height”;i:250;s:9:”mime-type”;s:10:”image/jpeg”;}s:15:”wp_rp_thumbnail”;a:4:{s:4:”file”;s:21:”IMG_5399b-150×150.jpg”;s:5:”width”;i:150;s:6:”height”;i:150;s:9:”mime-type”;s:10:”image/jpeg”;}}s:10:”image_meta”;a:10:{s:8:”aperture”;d:2.5;s:6:”credit”;s:14:”Gunter Schmidt”;s:6:”camera”;s:20:”Canon PowerShot S110″;s:7:”caption”;s:0:”";s:17:”created_timestamp”;i:1377709051;s:9:”copyright”;s:0:”";s:12:”focal_length”;s:3:”5.2″;s:3:”iso”;s:3:”200″;s:13:”shutter_speed”;s:15:”0.0333333333333″;s:5:”title”;s:0:”";}s:3:”url”;s:42:”kirgisische-kuehlerreparatur-kirgistan.jpg”;}

      funny enough only the 150x150px thumbnail seams to be affected…

      • Claus

        I tried to change the occurances from “IMG_5399b-150×150.jpg” to “kuehlerreparatur-auf-kirgisisch-kirgistan-150×150.jpg” through php_myadmin, but that did not work properly.

        • http://www.totorotimes.com/ Jordy Meow • Totoro Times

          Weird. Did you try with a fresh install of the plugin? The post thumbnail definitely works, of course the plugin takes care of it. Maybe are you using a special theme and this theme handles the post thumbnail in a manual way? Let’s please talk about the issue on the WordPress forums and not on this website. Thanks.