Images are usually the heaviest part of a page. A homepage with a few photographs straight from a phone can send several megabytes to a visitor on mobile data, and the slowest part of the page is often the one image the visitor sees first. On a store, where the product photos are the product, this matters twice.

This guide covers sizing, formats, file names, alt text and product photography, in the order I work through them. The speed side connects to Core Web Vitals; the store side to WooCommerce SEO.

Step 1: Resize to the size you display

A photograph from a modern phone may be 4,000 pixels wide. If it appears in a 600-pixel column, the extra pixels are wasted bytes. Resize the image to roughly the largest width it will actually display, allowing for high-density screens, and then compress it. This one step usually saves more than any plugin.

Step 2: Choose the right format

Google's image guidance lists the formats supported in Google Search: BMP, GIF, JPEG, PNG, WebP, SVG and AVIF, and asks that the file extension matches the actual file type.

UseUsually the best format
PhotographsWebP or AVIF; JPEG as a fallback
Logos, icons, simple graphicsSVG
Images needing transparencyWebP or PNG
Short animationsVideo or WebP instead of large GIFs

Free tools such as Squoosh let you compare formats and quality side by side. Reduce quality until you can just see a difference, then step back a little. Photos rarely need maximum quality.

Step 3: Serve different sizes to different screens

Google recommends using the srcset and sizes attributes on the img element, or the picture element, so the browser can choose a suitable size, always with an img fallback that has a src. WordPress and Shopify generate several sizes automatically when you upload, so check that your theme uses them and not the largest version everywhere.

Step 4: Reserve space and load smartly

  • Set width and height (or an aspect ratio) so the page doesn't jump while images load, which affects layout stability.
  • Lazy-load images below the fold, so they download only when needed.
  • Don't lazy-load the main image at the top, since it is usually what the visitor waits for and what the loading metric measures.
  • Use a CDN if your hosting plan or platform provides one, which shortens the distance to the visitor.

After changing images, test the page on a phone and in a speed tool, but read the score with care, as discussed in what a perfect PageSpeed score means for SEO.

Step 5: Name files properly

Google suggests short, descriptive file names, with my-new-black-kitten.jpg as its example of a good one and IMG00023.JPG as a poor one. For a store, black-leather-wallet-front.webp beats IMG_4521.webp. Use lowercase letters and hyphens. Arabic file names can cause problems in some systems, so use English transliteration in file names and put the Arabic in the alt text.

Step 6: Write useful alt text

Google calls alt text the most important attribute for image metadata and asks for descriptive, context-appropriate text without keyword stuffing. It helps search engines understand the image, and it is what screen readers announce, so it also serves accessibility (see website accessibility).

  • Describe what the image shows, in a short phrase: "Black leather wallet, open, showing card slots."
  • Write it in the page's language. Arabic pages get Arabic alt text.
  • Leave decorative images empty (alt="") so screen readers skip them.
  • Don't repeat the product name in every image's alt text. Describe the angle or detail.

Step 7: Use real images, not backgrounds, for content

Google's guidance says it finds images in img elements and doesn't index CSS background images. If an image is part of the content, such as a product photo, use an img. Reserve CSS backgrounds for decoration.

Keep text out of images

A promotional banner with the offer baked into the picture is invisible to search engines, can't be selected or translated, and is often unreadable on small screens. This is worse for Arabic, where the text also needs a mirrored layout. Use live text over a background image. See Arabic RTL design for the layout side.

Product photography that sells

Good product photos need discipline more than money.

  • Consistent background and lighting across the catalogue, so the store looks like one shop. Natural light from a window and a plain surface work for many products.
  • Several angles, including detail, scale next to a hand or a known object, and the product in use.
  • Colour that matches reality. Returns from "not as pictured" cost more than the shoot, which links to return and refund policies.
  • A clear first image that shows the whole product, because it appears in listings, search and social previews.
  • Your own photos where possible. Supplier images are used by every other seller, and they don't set you apart.

Image sitemaps and social previews

Google says image sitemaps can help it discover images it might otherwise miss, including images on a CDN. For most small sites, proper img markup is enough, but large catalogues benefit. Also set a good Open Graph image for each key page, since links shared on WhatsApp and social platforms show it.

A quick audit

  1. Run a speed test on your homepage and a key product page. Note the largest image.
  2. List images over a few hundred kilobytes and resize and compress them.
  3. Convert photographs to WebP or AVIF where your platform supports it.
  4. Check width and height attributes and the loading behaviour of the first image.
  5. Rename and add alt text to the 20 most important images.
  6. Replace images with baked-in text.

If you'd like this handled across a whole store, it is part of my e-commerce work.

Frequently asked questions

Which image format should I use?

Google Search supports BMP, GIF, JPEG, PNG, WebP, SVG and AVIF. For photos, WebP or AVIF usually gives smaller files than JPEG at similar quality; use SVG for logos and simple graphics. Always match the file extension to the actual format.

How important is alt text?

Google calls alt text the most important attribute for image metadata. Write a short, accurate description of what the image shows, in the language of the page, and don't stuff keywords.

Should I put Arabic text inside images?

Avoid it for anything that matters. Text baked into an image can't be searched, selected, translated or read by screen readers. Use real text over or beside the image.

Does Google index CSS background images?

Google's guidance says it finds images in img elements and doesn't index CSS background images, so use an img element for images you want to appear in image search.

Do I need a professional photographer for products?

Not always. Consistent lighting, a clean background and several angles matter more than expensive equipment. For a hero image or a premium brand, a professional is worth paying for.

Related reading

Adnan Basra

Written by Adnan Basra

Senior Web Developer & E-Commerce Manager based in Kuwait, with 13+ years building websites and driving organic growth for businesses. Get in touch →

Are your images slowing your site down?

I'll check your image sizes, formats and alt text and fix the ones costing you speed and search visibility.

Ask on WhatsApp Contact Me