Professional WordPress

How to automatically rename media attachments in WordPress?

Naming your media attachments correctly can be important for your site SEO, and there’s not much for search engines to go by to determine what an image depicts if they are named something like DSC10457.jgp for instance. If the image is of a cute cat, then it would be much better for SEO reasons to name the file cute-cat.jpg instead.

User may forget to give their images SEO friendly names before uploading them to WordPress. This can of course be fixed by renaming the file in question and uploading it again, though that can be time consuming. Automatically renaming the file name to match the title of the attachment would be much more efficient, and can be achieved with the Media File Renamer plugin.

How the Media File Renamer plugin works

The plugin renames media attachments automatically in WordPress according to the title of the file. The references to the files are also updated when files are updated. You will also see new options in the Media Library in list view which allows easy renaming. You can also lock the automatic renaming by clicking the lock icon in the same view.

WordPress media library added option rename media files
Added options in the WordPress media library to rename media files

How to automatically rename WordPress media files according to the title

Install and activate the Media File Renamer plugin, then follow what we did as an example:

Upload a poorly named image or document in the Media section in WordPress. The original file in our example was called oiusfhgiu.jpg, which is not very descriptive. Once the file was uploaded to WordPress then we selected to edit the image in directly from the WordPress upload screen,. You could do the same thing by clicking the image in the WordPress gallery and select Edit more details on the bottom right of the popup as well.

Automatically rename media by title WordPress plugin
Automatically rename a media file by changing its title

As you can see in the screenshot above, the filename has changed from oiusfhgiu.jpg to image-of-rikard.jpg, which is according to the title we gave the image. Note that the permalink of the attachment remains unchanged, this would have to be edited manually. Also note that it’s possible to rename the media filename directly using this plugin, but that functionality is only included in the pro version.

Do you need custom functionality on your WordPress installation?

Submit a support ticket here »

© 2022
WordPress Maintenance Plans
WordPress Page Speed Optimisation Service