Skip to content

How to Name Images for SEO: A Complete Step-by-Step Guide

Flat browser window icon beside the title How to Name Images for SEO

To name images for SEO, describe what the image shows in 3 to 5 lowercase words joined by hyphens. A good example is blue-ceramic-coffee-mug.jpg. Rename the file before you upload it, because WordPress cannot rename it afterward.

We checked every step in October 2026 against Google’s image SEO documentation and the WordPress 7.1 Media Library. Attachment Details still shows the file name as read-only text. A live rename needs a new upload and a redirect.

This guide covers the 9-step naming process for new uploads and a safe way to rename images that are already live. Then it shows a naming pattern for WooCommerce catalogs, the common mistakes and the other image signals that matter.

Why Image File Names Matter for SEO

WordPress Media Library list showing an uploaded image with an SEO file name

Image file names matter for SEO because they are one of the text clues Google reads about a picture. Google’s documentation says a file name gives only “very light clues” about what an image shows. Alt text and the surrounding page text carry more weight.

Google’s own example is that my-new-black-kitten.jpg is better than IMG00023.JPG. It also warns against generic names like image1.jpg and suggests automating names on large sites. If you translate a page, translate the image file names too.

The file name is only half the job. Our guide on adding alt tags to images in WordPress covers the field Google calls the most important image attribute.

A cleaner image library also helps your own team. You can find last month’s product photo in seconds without scrolling through hundreds of IMG files.

How to Name Images for SEO: 9 Easy Steps

Naming an image for SEO takes nine steps in WordPress. Pick the keyword, rename the file on your computer and upload it to the Media Library. Then fill in the title, alt text, caption and description in Attachment Details and click Update. Each image also gets its own attachment page, which you can disable.

  1. Open the image file on your computer and identify the exact keyword phrase it should target. Check Google Keyword Planner if you’re unsure.
    Google Ads Keyword Planner page with the Choose the right keywords heading
  2. Rename the file using that keyword in lowercase and separated by hyphens (for example blue-ceramic-coffee-mug.jpg).
    Renaming an image file in Windows File Explorer before upload
  3. Go to Media > Add Media File in your WordPress dashboard.
    Add Media File item under Media in the WordPress admin menu
  4. Drag and drop the renamed file into the uploader.
    WordPress Upload Media screen with the Drop files to upload area
  5. Click Edit under the thumbnail to open Attachment Details.
    Edit link under an image in the WordPress Media Library list
  6. Add a Title for the image.
    Title field on the WordPress Edit Media screen
  7. Type a full and descriptive sentence into the Alt Text field.
    Empty Alternative Text field on the WordPress Edit Media screen
  8. Add a Caption and Description if you want to add real context.
    Image Caption and Description fields on the WordPress Edit Media screen
  9. Finally, click the Update button to save the changes.
    Update button in the Save panel of the WordPress Edit Media screen

A good file name does not replace alt text. Fill in the alt text every time, even when the file name already looks perfect.

How to Rename Images That Are Already Live: Without Breaking Anything

To rename an image that is already live, upload a renamed copy and swap it into every post that uses it. Then add a 301 redirect from the old file URL. The free Redirection plugin handles that redirect in a few minutes.

  1. Go to Plugins > Add Plugin in your WordPress dashboard.
    Add Plugin item under Plugins in the WordPress admin menu
  2. Install and activate Redirection from the WordPress plugin directory.
    Redirection plugin card with the Activate button in the WordPress plugin search
  3. Rename the image file on your computer using your naming pattern and then upload it through Media > Add Media File.
    Add Media File item under Media in the WordPress admin menu
  4. Open the post or page using the old image and swap in the newly uploaded file.
    Replace menu on an image block in the WordPress block editor
  5. Copy the links of the old image and the new SEO-named image.
    Copy URL to clipboard button under the file URL on the WordPress Edit Media screen
  6. Go to Tools > Redirection to set up the image redirect.
    Redirection item under Tools in the WordPress admin menu
  7. Click the Add redirect button to create a new redirection.
    Add redirect button on the Redirection plugin Redirections screen
  8. Paste the old image URL into the Source URL field and the new image URL into the Target URL field.
    Source URL and Target URL fields in the Redirection plugin add redirect form
  9. Download a copy of the old file. Then open it in Media Library > Delete Permanently to remove the old attachment.
    Delete permanently link on the WordPress Edit Media screen

Warning: Delete Permanently cannot be undone. On most hosts the redirect only fires once the old file is gone, because the server sends an existing image without asking WordPress. Open the old image URL in a private window right after deleting and confirm it lands on the new image.

If the old URL shows a 404 page, your server answers image requests on its own. Ask your host to add the 301 redirect at server level, and re-upload the saved copy until they do.

Note: Renaming old images that already rank risks more than it gains. Prioritize new uploads first. WordPress also appends “-1” to files with duplicate names, which can quietly break your naming pattern. Check your Media Library for duplicates before renaming in bulk.

Naming Images at Scale for a WooCommerce Store

Naming images for SEO in a WooCommerce store works best with one fixed pattern for every product photo. Renaming five images by hand takes five minutes. Renaming five hundred one at a time is not realistic. The pattern has to be simple enough to automate.

A simple pattern solves most of this: product-name-color-angle.jpg, canvas-tote-navy-front.jpg and canvas-tote-navy-side.jpg. Keep every variant organized, both for Google and for your team.

For hundreds of SKUs, a bulk file renamer on your computer saves real hours before upload. Consistency matters more than cleverness. A boring and predictable naming system beats a clever one only you understand.

Clean names also help other tools that read your catalog. Our WooCommerce image search plugin, built by DevDiggers, lets shoppers search your products with a photo. To see how it compares, read our review of WooCommerce image search plugins.

Common Image Naming Mistakes to Avoid

The five most common image naming mistakes are keyword stuffing, generic names like image1.jpg, untouched stock photo names, skipped alt text and oversized files. Each one wastes a clue Google could use. The table below pairs every mistake with its fix and the reason it hurts.

MistakeSolutionWhy It Hurts
Keyword stuffingUse one clear description instead of ten forced keywordsLooks spammy to Google and confuses users
Generic labels like image1.jpgRename with a specific and descriptive term before uploadGoogle can’t guess what the image shows
Leaving stock photo names untouchedRename stock images the same as any other uploadWastes a chance to add real keyword context
Skipping alt textFill in alt text every time even with a great file nameScreen readers and Google both lose context
Uploading oversized filesCompress and resize before uploading and not afterSlows load time and image indexing

Fix these five habits and your image library works harder for search engines and for your own team.

Beyond File Names: Other Image SEO Signals Worth Knowing

Beyond file names, three more image SEO signals are worth setting up: a modern format, license metadata and an image sitemap. Lazy loading helps page speed on long pages. None of them replaces a good file name and alt text, but together they round out the setup.

  • WebP format: Google Search supports WebP and AVIF alongside JPEG, PNG and GIF, as listed in its image SEO guide. WebP files are usually smaller than JPEG at similar quality.
  • License metadata: Adding image license metadata through structured data or IPTC can earn the Licensable badge in Google Images.
  • Lazy loading: Defers off-screen images until the user scrolls to them, which speeds up initial page load.
  • Image sitemaps: An image sitemap helps Google find images it might miss, such as ones loaded with JavaScript.

Conclusion

Naming images for SEO isn’t complicated. Descriptive file names, hyphens instead of underscores, honest alt text, and a safe plan for images already published cover everything that matters.

The step most sites skip is the live rename. If you have years of “IMG_” files on your site, don’t rename everything at once. Start small, redirect the old URLs, and check Search Console before the next batch.

For a WooCommerce store, consistency beats perfection. Pick a pattern, apply it to every new product photo, and clean the backlog over time.

If your product images are already in good shape, pair them with a WooCommerce product search by image plugin so shoppers can find what they need just by uploading a photo.

Frequently Asked Questions (FAQs)

Q1. Does image file name affect SEO?

Yes. Google reads the words in your file name as one signal about what the image shows. It carries less weight than alt text or page content, but it adds up alongside everything else on the page. A generic name like IMG_4521.jpg gives Google nothing useful to work with.

Q2. What is the difference between a file name and alt text?

The file name is part of the image’s URL and rarely changes. Alt text sits in your page’s HTML, describes the image in a full sentence, and you can update it anytime without breaking a link. Rewriting alt text takes seconds, but a bad file name usually needs a redirect to fix safely.

Q3. How many words should an image file name have?

Three to five words is the sweet spot. Enough to describe what’s in the image, short enough to stay readable and avoid looking like keyword stuffing. A file like blue-ceramic-coffee-mug.jpg hits that mark. Going longer, with a string of ten keywords, reads as spam to both Google and shoppers scanning your gallery.

Q4. Is it safe to rename images that are already live on my site?

It can be, if you set up a 301 redirect from the old file URL to the new one. Skipping the redirect risks broken images and lost image search rankings you have already earned. Redirection, a free WordPress plugin, handles this step cleanly and takes about five minutes to set up correctly.

Q5. Why does WordPress add “-1” to some of my image file names?

WordPress automatically appends a number when you upload a file with the same name as one already in your Media Library. Check for duplicates before you upload in bulk or your naming pattern will quietly break. Search your Media Library for the exact keyword first. That way you catch a duplicate before WordPress renames it for you.

Q6. Should I put my target keyword in every single image on a page?

No. Use your primary keyword in one or two of the most important images on the page, and describe the rest in plain, accurate language. Repeating the same keyword on every image looks like stuffing to Google. Pick the hero image or the one nearest your main heading, and let the rest describe what’s really shown.

Q7. Should I use hyphens or underscores in image file names?

Use hyphens. Google treats a hyphen as a space between words. The name blue-ceramic-mug.jpg reads as three separate words. An underscore joins words together into one long string, like “bluceramicmug”. Search engines cannot break it apart the same way. Stick with lowercase letters and hyphens for every image you upload.

Q8. Does the image file name need to match my page URL slug?

No, but keeping them related helps. If your page targets “ceramic coffee mugs,” an image named ceramic-coffee-mug-set.jpg reinforces the same topic without copying the slug word for word. Matching them exactly isn’t required and can look repetitive if you have several images on one page.

Q9. Which image format is best for SEO: JPEG, PNG or WebP?

WebP, in most cases. It compresses smaller than JPEG or PNG at a similar quality level, which helps page speed, a confirmed Google ranking factor. Use PNG only when you need a transparent background, and save JPEG for photos where WebP support isn’t available.

Q10. Can renaming too many images at once hurt my SEO?

It can, if you rename live, indexed images without setting up redirects first. Google may show broken thumbnails in search results until it recrawls the page, and any external site linking to the old file URL will break too. Keep bulk renames to images that already have redirects ready.

Rishi Yadav
Rishi Yadav

Rishi Yadav is a content writer at DevDiggers who covers WooCommerce store management, WordPress performance and security. He works through each topic in a test environment before writing about it. His guides focus on the steps and settings that matter and skip the ones that sound good on paper.

Leave a Reply

Your email address will not be published. Required fields are marked *