Have you ever wondered how to change the filename of an image after you've uploaded it to your media file… without having to delete, rename on your computer, then re-upload?
We all know that having correct filenames (how-to-rename-media-files.jpg vs. IMG0326.jpg) is much better for SEO and google image search. The reason for this is because search engines can't see what your picture is showing, they can only read the data attached to it – the filename and alt tag.
When it comes to SEO, it's important to use acceptable keywords to help your webpage rank on search engines. Creating descriptive, keyword-rich file names is absolutely crucial for image optimization. Search engines not only crawl the text on your webpage, but they also search for keywords within your image file names.
Now, I'm not going to lie… when I first started this blog I had no idea about SEO or any of this image-name-alt-tag-mumbo-jumbo. I just uploaded photos and went about my posting. When I learned about SEO and it's effects, I started trying to find ways to rename and optimize my images without having to go back through my 300+ posts and re-do them all. That would've taken forever!
So I searched for a better alternative and found one… enter the Media File Renamer Plugin. This plugin does exactly what is says it's going to do… Rename Media Files… to whatever you would like by just changing the title of the image.
How it works
The plugin will look for file names that do not match the media or image title in the library.
For example if your filename is IMG0326.jpg and the image title is “How to Rename Media Files”, then the plugin will show a rename button next to the file. Clicking on rename button will change the image file name to how-to-rename-media-files.jpg.
Now, let's dive in and see how exactly to do that.
Install and Activate the Media File Renamer Plugin [FREE]
Go to the plugins page of your WordPress dashboard and search Media File Renamer. Then install and activate per usual.
After installing and activating the plugin head to Settings » File Renamer and you should see a screen like this
These are the boxes I have checked and settings I recommend and personally use but feel free to read about it and use your own settings and judgment.
- Basics: The files will be renamed automatically depending on the title.
- Side Updates:
- Update the references to the renamed files in the posts (and pages and custom types included)
- Update the references in the posts metadata (including pages and custom types metadata)
- The image slug will be renamed like the new filename
- The GUID will be renamed like the new filename
- Advanced: Attachments will be renamed automatically when published posts/pages are saved.
There is a PRO version that has new features where you can rename the file to something different than the title of the image, but I just use the free version as the title of the image is fine for me with being the filename.
Save your settings then head to the Media Library to begin renaming your images.
Edit the title of your images
In the media library if you have Grid View enabled…
you can click on the image and it will open in a popup…
then you can just type the new title of the image and new alt tag, then click the arrow > to go to the next image, do the same thing, click the arrow > to go to the next image, and so on until you have edited the titles of all your images.
Then head to Media » File Renamer. From there you can click Rename X flagged media or Scan All & Show Issues.
Personally, I like to click Scan All & Show Issues and scroll through the listings to make sure that they are all correct and show the correct name and such. After checking everything I just click Rename X flagged media and it will rename all the media that you just re-titled while updating all links in posts and pages for you.
For future posts and images, if you checked the box in settings that says Attachments will be renamed automatically when published posts/pages are saved then you can just write a post like normal but edit the filename when you upload it and then as soon as you click publish on the post the filename will be updated and so will all the links pointing to that filename.
Now you can head to the post in question and check the image if you would like to make sure that the filename was updated but it's not necessary.
You're all done!