All guidesFundamentals

SEO Image Filenames: The Naming Rules That Actually Follow Google's Guidance

Hyphens vs underscores, how many words, handling variants and near-duplicates, and a naming convention that stays consistent across hundreds of files and multiple locations.

July 25, 20268 min read
Hands sorting printed photographs into ordered stacks on a light studio table

As of July 2026, of all the image SEO advice in circulation, filenames have the strongest documentation-to-effort ratio. Google says explicitly, in its own image guidance, that the filename gives it clues about the subject. It costs nothing to do well. And the average site does it appallingly.

A quick audit of almost any WordPress media library will surface IMG_4471.jpg, Screenshot 2026-07-14 at 3.42.11 PM.png, final-final-v2-USE-THIS.jpg and unnamed (3).webp. Every one of those is a small piece of context thrown away.

What a good filename does

It describes the subject in a way a human could read aloud and understand, using words your page is genuinely about.

IMG_4471.jpg
→ arlington-tx-locksmith-rekeying-deadbolt.jpg

Screenshot 2026-07-14 at 3.42.11 PM.png
→ seopix-batch-generation-progress-view.png

unnamed (3).webp
→ ford-f150-transponder-key-programming.webp

The transformation is not clever. It is just doing the obvious thing at the moment the file is saved rather than never.

The rules, and the reasoning

Hyphens, not underscores

This is the one genuine technical rule rather than a style preference. Google has treated hyphens as word separators and underscores as joiners for well over a decade. car_key_replacement can be parsed as one long token; car-key-replacement parses as three words.

Pick hyphens and never mix. A site with both conventions is a site where someone will keep choosing wrong.

Lowercase everything

Some servers treat Photo.jpg and photo.jpg as different files; some do not. That inconsistency causes broken images on deploy far more often than it causes SEO problems, but both are avoidable by lowercasing everything, always.

No spaces, no special characters

A space becomes %20. An accented character becomes a percent-encoded mess. cerrajero-en-españa.jpg published as cerrajero-en-espa%C3%B1a.jpg is neither readable nor pleasant to link to. Transliterate to plain ASCII.

Three to six meaningful words

Enough for subject, action and — where genuinely relevant — location. deadbolt.jpg is too thin. best-cheap-emergency-24-hour-locksmith-arlington-texas-near-me-key-replacement.jpg is a keyword list wearing a filename costume, and it does nothing except look desperate.

Front-load the distinctive part

Filenames get truncated in tooltips, CMS listings and search results. Put the specific words first: f150-transponder-programming-arlington.jpg beats arlington-tx-services-f150-transponder-programming.jpg when only the first thirty characters are visible.

Does the filename have to match the alt text?

No, and it usually should not. They are read in different contexts and constrained differently.

A filename is a compact identifier — three to six words, hyphenated, no grammar. Alt text is a sentence read aloud to someone who cannot see the image. technician-cutting-car-key-blank.webp and "A technician cutting a blank car key on a bench-mounted machine" describe the same picture at appropriate lengths for their jobs.

What they should share is the subject. If the filename says deadbolt and the alt text describes a car key, one of them is wrong — and that mismatch is a genuinely common artifact of images being reused across pages without their metadata being revisited. The alt text guide covers the sentence side in full.

A convention that scales

Ad-hoc naming works until two people are doing it. Then you need a pattern. This one holds up across most business sites:

[subject]-[action-or-attribute]-[location?]-[variant?].[ext]
Image Filename
Storefront exterior, Arlington nybl-storefront-exterior-arlington-tx.webp
Technician cutting a key technician-cutting-car-key-blank.webp
Same shot, second angle technician-cutting-car-key-blank-closeup.webp
Product: key fob, black smart-key-fob-black-front.webp
Product: key fob, angled smart-key-fob-black-angled.webp
Fort Worth city page hero mobile-locksmith-van-fort-worth-tx.webp
Blog diagram transponder-key-programming-diagram.webp
Team headshot marcus-rivera-lead-technician.webp

Two things to notice. Variants are differentiated by something descriptive — closeup, angled, front — rather than -1 and -2, so the filename still tells you what it is. And the location appears only where the image genuinely relates to a location; the key-cutting shot could have been taken anywhere, so it claims nothing.

What your CMS does to the name

The convention survives contact with reality only if your platform cooperates. Three common environments, three different failure modes.

WordPress keeps the uploaded filename permanently and generates derivatives from it — upload IMG_4471.jpg and you also get IMG_4471-300x200.jpg, IMG_4471-768x512.jpg and however many sizes your theme registers. One bad name becomes six. Rename before uploading, every time; renaming inside the media library after the fact leaves the derivatives and any existing references pointing at the old name.

Next.js and similar frameworks serve files from /public under their real path, so the name you commit is the name that ships. The catch is the optimiser: next/image rewrites the delivered URL to something like /_next/image?url=...&w=828&q=75. Your descriptive filename still appears inside that url parameter, which is what a crawler resolves, so the name is not wasted — but do not expect the pretty path in the rendered HTML.

Headless CMSs and DAMs frequently assign a UUID on upload and keep the original name only as a display field. If that is your setup, check whether the delivery URL can be configured to use a slug rather than the asset ID. If it cannot, filename optimisation is largely unavailable to you and your effort belongs entirely in alt text and surrounding copy instead.

The general principle: verify the name on the live URL, not in the interface you uploaded through. It takes ten seconds and it is the only test that reflects what a crawler sees.

Renaming safely, when you must

Sometimes the names genuinely have to change — a rebrand, a migration, a site that inherited a decade of unnamed (3).webp. The rule is that a filename change is a URL change and gets treated like one.

  1. Map old to new in a spreadsheet before touching anything. You will need it for the redirects and for the rollback.
  2. 301 the old image URL to the new one. Image URLs get hotlinked, embedded in emails, and cited from other sites; a bare 404 breaks all of it.
  3. Update every reference — page HTML, structured data image fields, your sitemap, social meta tags, email templates. Missing one leaves a broken image in the place you look at least often.
  4. Resubmit the sitemap so discovery of the new URLs is not left to chance. The image sitemaps guide covers when a dedicated one is worth maintaining.
  5. Expect a lull. The new URLs start from zero in Google Images and take weeks to settle. This is normal and it is the main reason renaming for its own sake is rarely worth it.

If you cannot do all five steps, do none of them. A half-finished rename is worse than the bad names you started with.

Where teams go wrong

City-stamping one stock photo. Taking a single generic image and saving it as plumber-dallas.jpg, plumber-fort-worth.jpg, plumber-arlington.jpg and twenty-two more. The filenames are technically descriptive and the practice is the doorway-page pattern applied to images. If the picture does not depict the place, the filename should not claim it does.

Renaming published images for a quick win. Changing a filename changes the URL. The old URL 404s, whatever equity the image URL had is discarded, and anyone hotlinking gets a broken image. Fix your process forward; only rename during a migration where you are handling redirects anyway.

Letting the CMS decide. Upload IMG_4471.jpg and most systems keep it forever, then generate IMG_4471-300x200.jpg, IMG_4471-1024x683.jpg and four more derivatives — multiplying the meaningless name across every size.

Naming from the design file. Hero-Option-B-FINAL-approved.png describes your approval workflow, not the image. Nobody outside the project can parse it, and the project ends.

The volume problem, again

Everything above is easy for one file and unbearable at a hundred. That is the entire reason bad filenames persist: the person exporting fifty images on a deadline is not going to hand-name fifty files, and no amount of documented best practice changes that arithmetic.

There are only two durable answers. Either build renaming into the export step so it happens automatically, or generate the name at the same time as the image.

SEOpix takes the second route: you supply the business context once — name, city, service, keywords — and each generated file is written with a hyphenated, lowercase, Google-compliant filename derived from that context, alongside its alt text and EXIF metadata block. The naming convention is applied identically across a hundred-image batch, which is the part humans reliably fail at.

For multi-location work, the same mechanism produces per-city filenames that are accurate rather than stamped — see geotagging images for local SEO for how the location side of that works, and the bulk workflow guide for the monthly production version.

A word on URL structure around the file

The filename is only part of the path, and the directory it sits in is free context you are probably wasting.

/img/a7f3c2.webp tells a crawler nothing beyond the filename. /images/services/car-key-replacement/technician-cutting-key-blank.webp places the file in a hierarchy that mirrors the site — and hierarchies are one of the ways search engines infer what a resource relates to.

You do not need deep nesting. One meaningful directory level is usually enough: /images/blog/, /images/products/, /images/locations/arlington/. What you want to avoid is the two common extremes — everything dumped in a single flat /uploads/ folder, or a date-based structure like /2026/07/ that encodes when you uploaded rather than what the file is.

Two related points. Keep the extension honest: a WebP file named .jpg because the pipeline renamed it confuses caching layers and occasionally browsers. And serve images from the same domain as the page where you reasonably can — a separate CDN domain is fine and normal, but it means verifying that domain in Search Console if you want the data attributed properly, as covered in the image sitemaps guide.

Fix the next hundred, not the last thousand

The realistic move is not a rename project. It is a convention, written down, applied from your next batch onward — plus a quick look at your top twenty pages to see whether anything important is sitting on a camera-default name and can be fixed while you are making other changes to those pages anyway.

The full image SEO checklist covers where filenames sit among the other pre-publish items. If you want the naming handled at generation time, ten images a month are free and the pricing tiers scale from there.

Frequently asked questions

Do image filenames actually affect SEO?+

Yes — this is one of the few image SEO items Google states outright. Its image documentation says the filename gives Google clues about the subject of the image. It is a modest signal compared with page content, but it is documented, free and entirely under your control.

Hyphens or underscores in filenames?+

Hyphens. Google has long treated hyphens as word separators and underscores as word joiners, so car_key_replacement can be read as a single token while car-key-replacement reads as three words. Use hyphens everywhere and never mix conventions within a site.

How many words should a filename have?+

Three to six meaningful words is the practical range. Enough to identify the subject, the action and where relevant the location, without turning the filename into a keyword list. Past about six words you are adding characters that no longer add clarity.

Should I rename images that are already published?+

Usually not for SEO alone. Renaming changes the URL, which means the old image URL 404s and any accumulated signals reset. Fix filenames going forward, and only rename retroactively during a migration you are already doing with proper redirects in place.

Should the city go in the filename for local pages?+

If the image genuinely depicts or belongs to that location, yes — it is accurate and adds context. If you are stamping fifty city names onto the same stock photo, that is not filename optimisation, it is the doorway-page pattern with extra steps.

Do numbers and dates belong in filenames?+

Only when they are part of the subject — a model year, a product number, an event year. Sequence numbers like -1, -2, -3 are acceptable for genuine variants of the same subject, but they carry no meaning, so prefer a descriptive differentiator where one exists.

What about non-English characters and spaces?+

Avoid both. Spaces become %20 in URLs and accented or non-Latin characters get percent-encoded into unreadable strings. Transliterate to plain lowercase ASCII with hyphens — the URL is read by machines and pasted by humans, and both prefer it clean.

Let SEOpix handle the metadata

Filenames, alt text, EXIF fields and GPS coordinates written automatically as each image is generated. Start with 10 free images a month — no credit card required.

Keep reading