Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Rename Images and Media Files in WordPress

Ever wanted to change an image file name after uploading it to WordPress? Image file names are important for image SEO and can help more users find your website.

While WordPress allows you to change an image alt tag and caption, there is no built-in option to change an image file name from the admin area.

In this article, we will show you how to easily rename images and media files in WordPress. We’ll also show you a method to replace media files after renaming them on your computer.

Rename image files and media in WordPress

Why Rename Images and Media File Names in WordPress?

Images can help you get more traffic to your website. Particularly, if you upload original images and other media files to your website.

However, unlike text, search engines and users both need your help to describe those images. This is a major part of optimizing image SEO.

One of the best ways to help search engines and your users find these images is by giving them a meaningful filename. For example, a file name like newyork-skyline.jpg is a lot more helpful than DSC00789.jpg.

Now the problem is that a lot of users upload images directly from their phones or cameras. Some users download images from other sources and forget to rename them before the upload.

Once you have uploaded those images to WordPress, there is no default option to rename those images or any media files.

Having said that, let’s take a look at how to easily rename images and media files in WordPress.

Renaming Images and Media Files in WordPress

This method does not automatically change the image file name in WordPress. However, it does allow you to manually change an image filename inside the WordPress admin area.

The first thing you need to do is install and activate the Phoenix Media Rename plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, simply go to Media » Library. If your media library is displayed in the grid view, then you will need to switch to the list view.

Switching from grid to list view in WordPress media library

This will allow you to view more details for each media file including the file name.

Next, you need to click on the ‘Edit’ link below the image or media file that you want to rename.

Edit media file

This will open your image in the WordPress media edit screen. From here, you can edit details of an image like Alt tag, caption, and more.

Scroll down to the bottom and you’ll see the filename field.

Change image file name

From here, you can change the file name. We recommend giving it a keyword-focused and meaningful name that actually describes the image. We recommend only using all lowercase letters and dashes between two words.

After that, click on the ‘Update’ button to save your changes.

That’s all. You have successfully renamed the media files without leaving the WordPress admin area. The plugin will also update the file name if you have used the image in a post or page.

Replace Image and Media Files in WordPress

If the above method does not work you, then you can try this method. Basically, you’ll download the file to your computer and rename it there.

After that, you’ll replace the original file on your website with the renamed version by using a plugin.

The first thing you need to do is install and activate the Enable Media Replace plugin. For more details, see our step by step guide on how to install a WordPress plugin.

After that, visit Media » Library page. If you are using the grid-view, then you would need to switch to the list view.

Switching from grid to list view in WordPress media library

You will now see a new link to replace the media below each item in your media library.

Replace media link

This will bring you to the replace media page.

First, you need to choose the file from your computer that you want to upload and replace the old file with. Make sure that you have already changed the file name on your computer.

After that, you need to scroll down a little for more options.

Under replacement options, you can choose whether you just want to replace the file or also want to replace all the links. We recommend using the second option if you have already added that file to your WordPress posts and pages.

Replace options

You can also choose to keep the old date or use a new date.

Finally, click on the ‘Upload’ button to replace the old media file with the new and renamed file.

We hope this article helped you learn how to easily rename images and media files in WordPress. You may also want to see our article on best WordPress image compression plugins compared.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

34 CommentsLeave a Reply

  1. I use the Phonix Media Rename plugin for changing the file name of images. But, this plugin is not changing the link of the image. The image link still has the old file name. Is there, any problem with the canonical tag OR now there is duplication of image files on the website?

    • If you are concerned with redirects the Phoenix Media Rename plugin works with the Redirection plugin to create redirects for the changed images.

      Admin

  2. No more filename box to rename images. Gotta use a plugin and/or the hard-way (taking images down from media library, rename, and put them back in).

  3. Is renaming the image after they are uploaded going to break any links that are out there to the images? Will autoredirects be set up?

  4. Thank you for your post.

    Since I haven’t tried it yet, I wonder what happen if I rename the file directly from inside the cpanel File Manager.

    • Issues pop up when updating your file names through that method as it wouldn’t update on WordPress’ end.

      Admin

  5. After changing the image Filename using the Phoenix Media Rename plugin, I notice the “/new name text.jpg” of the “File URL” automatically changes to match the new Filename. However, I also notice the “Permalink” URL still remains the same (the end text still has the old Filename included; in other words, “/old name text.jpg”). I suppose this it to not “lose” the placement of the image in the site.

    Am I understanding this correctly? Should I just leave the Permalink as it is?

  6. when move cursor in image, My images have a terrible naming structure and it is very distracting to the user to see “IMG_1234.JPG”.

    is there is any solution to remove this

    • If it is not the name of the image then you would want to check the image’s alt text and caption for where that would be.

      Admin

  7. Hi, Will renaming the images using a plugin, then compress after will return the images’ name to original? Thanks!

    • You would need to check with the support for the plugin you’re planning to use if their plugin works that way.

      Admin

  8. Couldn’t I just change the name of the file on my desktop, upload it to my media file and replace current image with new image with new title? (file name)

    • That would be another option if you know all of the locations the file is on your site.

      Admin

      • hello and thanks for the response, you actually made me realize how issues can arise. Changing a pic and not updating all the file locations.

        In my case I think its easy, im changing my hero pic and logo. These are controlled by my theme and I hope will update the new url once I replace the images.

        • You’re welcome! if it is in only those locations then you should be fine :)

  9. Fantastic had Phoenix Media Rename downloaded for a while as got a client who insists to not rename their images before uploading so was looking for a solution. I installed it on a test site and couldn’t figure it out as it doesn’t mention anywhere about switching to the list view ! Your post just stopped me buying Media File Renamer Pro ! So thanks for that.
    Best Wishes.
    Mark

  10. Thanks for this article.

    Question about the Phoenix Media Rename plugin:

    Once I’ve replaced the filenames, do I need to keep the plugin active? Or is it fine to use it to rename files, then deactivate?

    Cheers!

    • You may want to double-check with the plugin’s support but at the moment it is fine to remove the plugin after renaming the files.

      Admin

  11. Hello to all!
    I am working on a project made in wordpress and I am stuck on this part:

    When a author post a new article and attach an image like image.jpg, and other author posts another article with the same image name image.jpg, the second article will be owerwrited by the first name on that image.jpg (from the first post)…

    The question is: ,if there is a way to prevent that automatically, in functions php, js(ajax), etc…??

    I am facing with this for one week (technically speaking) ….

    Any info. will be appreciated…

    • It would depend on the tool you’re using to change the image name, you would want to reach out to the plugin’s support for preventing overwriting.

      Admin

      • Hey, thanks for the answer.
        In the meanwhile, i did it with js, renaming the file before uploading.

  12. Hello. Why is it that I’m not seeing the filename field at the bottom of the WordPress media edit screen? Thanks for your help.

    • There are a few possible reasons, you may want to check the top right for another possible location for the file name :)

      Admin

    • It would depend on the method you are using, currently, the first method would change the permalink for the image and update it where the image is placed on your site.

      Admin

    • It would depend on the method you are using. If you reach out to the plugin’s support they should be able to assist.

      Admin

Leave a Reply to Radu Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.