Make Filename Lowercase : WordPress Plugin

Sets uploaded media filename to lowercase as filter on ‘sanitize_file_name‘. Based on post at Stack Overflow asking if there is a way to “Rename files during upload within WordPress 3.0 backend”.

Built for WordPress 3.0.1+ which saves any media (Image, Video, Audio) as lowercase. This effectively changes the name of the file at upload if a user were to upload a file with any uppercase characters.

For instance:

MOVIE-FILE.MOV > movie-file.mov
Movie-File.wmv > movie-file.wmv
ImAgEfILe.gif > imagefile.gif
imageFile.JPG > imagefile.jpg
ETC > etc

* WordPress sets file extension to lowercase. This plugin applies strtolower on the filename.

Frequently Asked Questions:

Why was this plugin created?
This plugin evolved from a client requirement that all uploaded media filenames contain no uppercase characters.

Why did you release this plugin?
It was useful to me and I wanted to work through the process of releasing a WordPress plugin.

Why shouldn’t this just be added to a theme’s functions.php file?
Upgradeability, portability, backwards compatibility, and other *abilities. If for some reason this function were in need of customization due to a WordPress version upgrade, the plugin will be centrally responsible for releasing the fix as opposed to updating the theme(s).

Upload Media Filename
Upload media filename of mixed case (in this case, the file MIXED-cAsE-filename.JPG).
Filename is Lowercase
Filename changed to lowercase (mixed-case-filename.jpg) preserving the case for Title.
Confirm Lowercase Filename
An image detail view from the Media Library showing the new File name as lowercase.

Change Log:
1.0.0

* Initial release
More

Download Make Filename Lowercase

Post written by Ed Reckers

Founder and lead web development consultant at Red Bridge Internet : San Francisco WordPress Developers and Consultants.

4 Responses to “Make Filename Lowercase : WordPress Plugin”

  1. WordPress Plugin Releases for 2/12 « Weblog Tools Collection

    […] Make Filename Lowercase sets uploaded media filenames to lowercase as a filter on sanitize_file_name. […]

  2. Tomáš Kapler

    there is a bit old plugin http://wordpress.org/extend/plugins/uploadplus/ who does the same plus some more function (replace strange characters, utf to iso, spaces to dashes …) but it uses some obsolete functions (turn on wp-debug to true to see the problems) – this could be a good inspiration for you to improve

    P.S.: i recommend also to automaticaly change title – underscore and dashes to space and maybe Big first letter. And maybe description from image meta if available. But this may be out of scope of such plugin.

  3. ereckers

    Thomas, thanks for pointing this out. It does look like this plugin has been abandoned and could use some support. I’ll definitely take a look at it and it would be an interesting project. Thanks for stopping by.

  4. WordPress Wednesday: Make Filename Lowercase « BlueFur.com

    […] For whatever reason, you may have some files with a mix of upper and lower-case characters, making for some challenges when you upload and share these files online. Overcoming this concern is the appropriately named Make Filename Lowercase. […]

Leave a Reply