Image Optimization for SEO: Size, Format, Filenames and Alt Text
A search engine cannot look at a picture; it reads the filename, the surrounding text and the page behaviour. An eight-point checklist to run before anything is published.
A search engine cannot look at a picture; it reads the filename, the surrounding text and the page behaviour. An eight-point checklist to run before anything is published.
A search engine cannot look at a photograph and understand it. It reads the filename, the alt text, the sentences around it and how quickly the page became usable. Image optimization is therefore two jobs wearing one name: making the file technically light, and telling a machine what the picture is. Skip either half and the page either never appears in image results or appears and never gets clicked.
On the technical side, the image resizer and image compressor are the core pair, with JPG to WebP handling the container swap. On the meaning side, the slug generator produces clean filenames, the character counter keeps alt text within range, and the image cropper fixes framing.
The effect arrives through two channels. The direct one: image search is its own traffic source, and appearing there depends heavily on the filename, the alt text and the content wrapped around the picture. The indirect one: heavy pictures stretch out how long a page takes to become usable, which degrades experience metrics that apply to the whole page, not just the image.
The indirect channel usually matters more, precisely because it is not limited to one asset. Taking the four pictures on an article from 3 megabytes down to 400 kilobytes produces a measurable improvement without a single word of copy changing.
The name a camera assigns communicates nothing. A lowercase, hyphenated name describing the contents informs both the crawler and whoever opens that folder six months from now.
A good example: blue-backpack-side-view-1600.webp. Bad examples: DSC_0421.JPG, or best-backpack-cheap-backpack-backpack.jpg. The second bad example does more damage than the first.
The primary job of alt text is telling someone who cannot see the picture what is there. Do that job properly and the search side takes care of itself. Attempting the reverse, treating alt text as a keyword container, damages accessibility and reads as spam to a crawler.
| Situation | Alt text | Reason |
|---|---|---|
| Informative photograph | Short and descriptive | Conveys the content |
| Purely decorative image | Left empty | Screen readers skip it |
| Image acting as a link | Names the destination | Makes the target clear |
| Chart or diagram | States the key finding | Moves the data into text |
| Image containing words | Repeats the words | Otherwise the text is lost |
A workable length limit is around 125 characters. Anything longer belongs in a caption or in the body copy, not in the alt attribute.
The most useful habit when writing alt text is imagining you are describing the picture to someone over the phone. In that description you would never say “image of” or “photo of”; you would just say what it is. The same applies here: “blue backpack seen from the side” is complete, and prefixing it with “a photo of” only wastes characters.
These eight points are the gate a picture passes before it ships. All of them take minutes.
The last point is the one most often skipped. Crawlers infer a picture's subject largely from the copy surrounding it, so an image dropped into an unrelated section stays contextless no matter how clean its markup is.
Fixing individual files is not the whole job; the page has a budget too. A practical approach is to set an image budget per page type: one hero plus at most four in-body pictures for an article, one main shot plus six gallery images for a product page. When the budget is full, adding a picture means removing one.
The classic gallery mistake is serving full-size files as thumbnails. Putting a 1600-pixel file into a 120-pixel thumbnail slot is the largest single waste on such a page, and it hides well because everything looks correct. Generating real thumbnails routinely halves the total weight of a gallery page.
Then there is the top of the page. The picture visible before any scrolling determines how long the visit feels like waiting. It is entirely rational to spend more effort on that one file than on all the others: the most aggressive compression trials, the tightest crop and the smallest viable dimensions all belong there.
An archive cleaned once degrades again within a quarter, because new content keeps arriving. Durable results come from a small repeating loop rather than a heroic one-off cleanup.
The loop starts with measurement. Once a month, open your ten most visited pages and check total image weight; those ten usually carry most of the traffic, so that is where improvement pays best. Step two is listing the pages that exceed your threshold. Step three is working through the list at one page a week. Plans that try to fix an entire archive in a single weekend tend to stall halfway.
Do not measure weight alone. Missing alt text, duplicated filenames and images without dimension attributes belong on the same list. Those three are less visible than file size and their effects last longer: a picture with no alt text simply does not exist as far as image search is concerned.
Finally, mark the pages you have finished. Without a marker you reopen the same pages every round. A trivial bit of bookkeeping repays itself by the second month, and the work turns into routine.
A descriptive name helps; a stuffed one does not. The difference is not intent but readability: if the name reads like a phrase when spoken aloud it is fine, and if it reads like a list it is harmful.
Yes, there is no duplicate-content penalty for images. Even so, writing the alt text fresh for each page describes what the picture is doing on that particular page, which is the point of the attribute.
If your pages are crawled normally, most sites do not need one. It earns its place on layouts that load pictures through scripts, where a crawler cannot easily discover them.
Not in itself, but remember that the words exist only inside the picture. Repeat the same phrase in the page heading or the opening paragraph so the information does not disappear with the image.
To settle the format question, read how to choose an image format; to hit the weight targets, see image compression and web performance; and to fix a whole archive at once, follow the batch image conversion workflow.