Skip to content
ImgPress.online
SEO images

How to Optimize Images for SEO: A Practical Checklist

Good image SEO helps your pictures show up in search and keeps pages fast. This checklist follows Google's own guidance, step by step.

ImgPress EditorialPublished Updated 7 min read
Share:
Illustration for How to Optimize Images for SEO: A Practical Checklist
On this page

Image SEO has two jobs. The first is helping search engines understand your images, so they can appear in Google Images, image packs and Discover, and so they reinforce what the page is about. The second is keeping images from dragging down page speed, which affects user experience and feeds into Core Web Vitals.

Neither job is complicated. Most sites fall short on the basics: camera-default file names, missing alt text, 4 MB hero photos and images that make the layout jump around while the page loads. Fix those and you're ahead of a lot of the web.

Here's the checklist, based on Google Search Central's published image guidelines plus standard performance practice.

Does Google need images in HTML to find them?

Yes, and this trips up more sites than you'd think. Google finds images through the src attribute of <img> elements (including those inside <picture>). According to Google's documentation, images referenced only from CSS, such as background-image, aren't indexed.

So if an image matters for search (a product photo, a recipe shot, an infographic) put it in the HTML as a real <img>. Keep CSS backgrounds for decoration.

The same goes for images that only appear after a click or a script runs. Google renders JavaScript, but it's safest to make important images available in the rendered HTML without needing interaction.

How should you name image files?

Google's guidance notes that file names can give it light clues about the subject of an image. Compare:

Weak Better
IMG_4821.jpg blue-ceramic-coffee-mug.jpg
screenshot-2026-09-14.png wordpress-media-settings-page.png
final_v3_FINAL.webp sourdough-loaf-crumb-closeup.webp
photo1.jpg lake-bled-island-church-autumn.jpg

Keep names short and descriptive, use hyphens between words, and stick to lowercase. Don't stuff keywords in. best-cheap-coffee-mug-buy-coffee-mug-online.jpg reads like spam to people and doesn't help with search engines either.

It's worth getting into the habit at upload time. Renaming hundreds of images later means updating every URL that points to them.

How do you write alt text for SEO?

Alt text is the most important piece of image metadata. Google uses it, along with page content, to understand what an image shows, and screen readers read it aloud to people who can't see the image. That second purpose should drive how you write it.

Good alt text describes the image in context, briefly and specifically:

  • Weak: alt="mug"
  • Weak: alt="coffee mug coffee cup ceramic mug best mug"
  • Better: alt="Blue ceramic coffee mug with a speckled glaze on a wooden table"

Purely decorative images (dividers, background flourishes) should have an empty alt="" so screen readers skip them. Our alt text guide goes into much more detail, with examples for products, charts and screenshots.

Tip: Place images near relevant text. Google uses the page content around an image, including headings and captions, to understand it. A product photo next to the product description is far more useful than the same photo in a sidebar.

What size should images be?

Two separate questions here: pixel dimensions and file size.

Pixel dimensions should match how big the image is actually shown, allowing for high-density screens. A photo displayed 800 pixels wide should be around 1600 pixels wide at most, not the 4000+ pixels straight from a camera. Use Resize Image to bring originals down before uploading.

Better still, provide several sizes with srcset and sizes so phones download a small version and large monitors a bigger one:

<img src="mug-800.webp"
     srcset="mug-400.webp 400w, mug-800.webp 800w, mug-1600.webp 1600w"
     sizes="(max-width: 600px) 100vw, 800px"
     alt="Blue ceramic coffee mug with a speckled glaze"
     width="800" height="600">

File size comes down to compression. For most photos, a quality setting around 75 to 85 keeps them looking the same while cutting size substantially. Compress Image does this in your browser without uploading anything. Our guide to compressing images without losing quality covers the settings in depth.

There's one exception worth knowing about: if you want large image previews in Google Discover, Google recommends images at least 1200 pixels wide, along with the max-image-preview:large robots setting (or AMP). Big doesn't mean bloated, though: a 1200-pixel WebP can still be well under 200 KB.

Which image formats does Google support?

Google Search supports BMP, GIF, JPEG, PNG, WebP, SVG and AVIF. In practice, the question is which one keeps files smallest for the content.

  • Photos: WebP or AVIF, typically smaller than JPG at similar quality
  • Logos and icons: SVG, or PNG/WebP when SVG isn't practical
  • Screenshots and graphics: PNG or lossless WebP

You can convert existing photos with JPG to WebP. If you need to support very old browsers, serve a fallback through the <picture> element. See our guide to the best image formats for the web for an example.

How do you prevent layout shift from images?

Cumulative Layout Shift (CLS) measures how much the page jumps around while loading. Images are a classic cause: the browser doesn't know how tall an image will be until it downloads, so text below it suddenly gets shoved down.

The fix is simple. Always set width and height attributes on <img> elements:

<img src="lake-bled.webp" alt="Lake Bled with the island church in autumn"
     width="1600" height="1067">

Modern browsers use these to calculate the aspect ratio and reserve the right amount of space before the image arrives. Your CSS can still make the image responsive with max-width: 100%; height: auto;. The attributes set the ratio; CSS sets the displayed size.

For images in containers where the ratio is controlled by CSS, the aspect-ratio property does the same job.

Should you lazy load images?

Yes, for images below the fold. Native lazy loading is one attribute:

<img src="gallery-3.webp" alt="..." width="800" height="600" loading="lazy">

The browser then waits until the image is near the viewport before downloading it. That saves bandwidth and speeds up the initial load. Google's documentation confirms that it can find lazy-loaded images as long as they're implemented in a search-friendly way, and native loading="lazy" is.

Don't lazy load the main image visible when the page first opens. That's often your Largest Contentful Paint (LCP) element, and lazy loading it delays the very thing LCP measures.

How do you speed up the LCP image?

If the largest visible element on load is an image (common on blogs, product pages and landing pages), give it priority:

<img src="hero.webp" alt="..." width="1600" height="900" fetchpriority="high">

The fetchpriority="high" hint tells the browser to fetch it ahead of less important resources. Combine that with:

  • No loading="lazy" on this image
  • A reasonable file size (compress and resize it properly)
  • The image in the initial HTML, not injected later by JavaScript
  • A <link rel="preload"> if the image is only discovered late (for example, inside CSS)

Do you need an image sitemap?

Not always. If your images are in standard <img> tags on crawlable pages, Google will usually find them. An image sitemap helps when images are hard to discover, such as when they're loaded by JavaScript, or when you want to make sure Google knows about images that matter to you.

You can add image entries to your existing sitemap with the image extension:

<url>
  <loc>https://example.com/mugs/blue-ceramic/</loc>
  <image:image>
    <image:loc>https://example.com/images/blue-ceramic-coffee-mug.webp</image:loc>
  </image:image>
</url>

Note: Google deprecated several older image sitemap tags (like caption, title and license) in 2022. Only image:loc is needed now.

What about structured data?

Structured data doesn't make images rank on its own, but it helps Google understand what an image represents, and certain rich results require images. Product, Recipe, Article and several other schema types have an image property. Make sure it points to a crawlable, high-quality image that's actually on the page.

If you license your photos, you can also add image license metadata (through structured data or IPTC photo metadata), which lets Google show a "Licensable" badge in Google Images. You can check what's embedded in an image with the Image Metadata Viewer.

For social sharing, set an Open Graph image (og:image) on each page. It controls the preview on most social networks and messaging apps, and it's easy to forget.

Quick image SEO checklist

Run through this before publishing:

  1. Important images use <img> in HTML, not CSS backgrounds
  2. Descriptive, hyphenated file names
  3. Helpful alt text (or alt="" for decorative images)
  4. Images placed near related text, with captions where they help
  5. Resized to display size, with srcset for responsive delivery
  6. Compressed, ideally in WebP or AVIF
  7. width and height set on every image
  8. loading="lazy" on below-the-fold images only
  9. fetchpriority="high" on the LCP image
  10. Structured data and og:image where relevant

None of it is glamorous, but together these steps make images faster, more accessible and easier for search engines to understand.

Written by ImgPress Editorial

Our editorial team writes and maintains practical guides on working with images. Articles are reviewed for accuracy and updated when tools or best practices change. Spotted an error? Let us know.

Questions readers ask

Do image file names affect SEO?

Google says file names can give it light clues about an image's subject, so a descriptive name like red-trail-running-shoes.jpg is better than IMG_4821.jpg. It is a small signal compared with alt text and surrounding page content, but it costs nothing to get right.

Should I lazy load every image on the page?

No. Lazy load images that start below the fold. The main image visible when the page first loads, often the Largest Contentful Paint element, should load normally and ideally be prioritized, because delaying it slows down how fast the page appears.

Can Google index images set as CSS backgrounds?

Google's guidance is that it does not index images referenced only through CSS, such as background-image. If you want an image to appear in Google Images, place it in the HTML with an img element and a src attribute.