We use cookies to keep this site working and, with your permission, to remember your preferences, understand site traffic and support advertising. You can change your choice at any time. Cookie Policy

SEO Tool Orbit
Website Optimization

How to Optimize Images for SEO, Accessibility, and Speed

Image SEO is mostly careful HTML. Here's how to mark up images so they load fast, describe themselves to screen readers, and can be found in image search.

By SEO Tool Orbit5 min read

Illustration of the same image at three sizes beside a caption tag representing alt text
One image, several sizes, one good description. · Original illustration by SEO Tool Orbit

Images make pages useful, and they're often what makes pages slow and inaccessible. The fixes are less about clever tools and more about careful implementation: the right file at the right size, described properly, loaded at the right moment. This guide covers the markup and decisions; our AI image optimisation guide covers compressing and enhancing the files themselves.

In short: give images descriptive filenames and real <img> elements, write alt text that conveys what the image communicates (and empty alt for decorative images), set width and height, serve responsive sizes with srcset, compress into modern formats, lazy-load images below the fold but not the main image, and add image sitemap entries only when images are central to your content.

Image filenames

A filename like blue-trail-running-shoe-side.webp tells search engines something; IMG_4821.jpg tells them nothing. Use lowercase words separated by hyphens, describe the subject, and keep filenames stable — changing an image's URL means search engines have to discover it again.

Descriptive alt text

Alt text is read aloud by screen readers, shown when an image fails to load, and used by search engines to understand the image. The question to ask is: what does this image communicate in this context?

ImageWeak altUseful alt
Product photoshoeBlue trail running shoe with a thick lugged sole, side view
Chart in an articlechartBar chart showing page weight falling sharply after the images were compressed
Logo linking homelogoExample Store home page
Screenshot of a settingscreenshotSitemaps report in Search Console showing one submitted sitemap with status Success

Keep alt text concise, skip "image of" (screen readers announce it's an image), and don't stuff keywords. For a complex chart, summarise the key point in the alt and explain the details in the surrounding text.

An alt text decision guide

  1. Is the image purely decorative? Use alt="".
  2. Is it a link or a button? Describe what it does or where it goes ("Search", "Example Store home page").
  3. Does it contain text that matters? Include that text in the alt — or better, move it into real text.
  4. Is it a complex chart or diagram? Give a short alt with the key point and explain the details in the surrounding text.
  5. Otherwise, describe what the image shows that's relevant to the page.

Decorative versus informative images

Not every image needs a description. Decorative images — background flourishes, dividers, icons next to text that already says the same thing — should have an empty alt attribute so screen readers skip them:

<img src="/images/divider.svg" alt="">

Leaving the attribute out entirely is different: some screen readers then read the filename aloud. Always include alt; leave it empty only on purpose.

Dimensions and responsive images

Always set width and height. The browser uses them to reserve space before the image loads, which prevents layout shift. Then let the browser choose the right file size for each screen:

<img
  src="/images/trail-shoe-800.webp"
  srcset="/images/trail-shoe-400.webp 400w,
          /images/trail-shoe-800.webp 800w,
          /images/trail-shoe-1600.webp 1600w"
  sizes="(min-width: 1024px) 50vw, 100vw"
  width="1600" height="1200"
  alt="Blue trail running shoe with a thick lugged sole, side view">

srcset lists the available widths; sizes tells the browser how wide the image will be displayed, so a phone downloads the small file and a large screen the big one. Frameworks such as Next.js generate this markup for you from a single source image.

Compression and modern formats

WebP is widely supported and usually much smaller than JPEG or PNG at similar quality; AVIF often compresses further. Serve modern formats with a fallback where needed:

<picture>
  <source srcset="/images/hero.avif" type="image/avif">
  <source srcset="/images/hero.webp" type="image/webp">
  <img src="/images/hero.jpg" width="1200" height="675" alt="…">
</picture>

On SEO Tool Orbit you can resize images to their display size, convert them to WebP or AVIF, and compress them — and strip camera metadata, which also protects privacy, before uploading.

Lazy loading

Add loading="lazy" to images below the fold so they load only as the reader scrolls toward them. Don't lazy-load the main image at the top of the page — it's often the Largest Contentful Paint element, and delaying it slows the page. For that image, consider fetchpriority="high" instead. The Core Web Vitals guide explains how images affect loading metrics.

Image sitemaps, where appropriate

Search engines find most images through your pages. If images are central to your content — a photography portfolio, product galleries, recipes — you can list them in your sitemap with the image extension:

<url>
  <loc>https://example.com/products/trail-shoe</loc>
  <image:image>
    <image:loc>https://example.com/images/trail-shoe-1600.webp</image:loc>
  </image:image>
</url>

The sitemap root must declare the namespace xmlns:image="http://www.google.com/schemas/sitemap-image/1.1". The XML sitemap guide covers the rest of the sitemap.

Image accessibility mistakes

  • Text inside images for important information — screen readers can't read it, and it doesn't scale. Use real text.
  • The same alt text on every image, often the page title.
  • Important images as CSS backgrounds, which have no alt text and aren't treated as content.
  • Missing alt on linked images, leaving the link with no accessible name. The alt should describe the destination.
  • Captions that repeat the alt text word for word. Use the caption for context; use the alt for what the image shows.

Image SEO checklist

  • Descriptive filename and a real <img> element.
  • Alt text that conveys the image's purpose, or empty alt if it's decorative.
  • Width and height set; responsive sizes via srcset.
  • Compressed, in a modern format, no larger than needed.
  • Lazy-loaded if below the fold; prioritised if it's the main image.
  • Placed near the text it illustrates, with a caption where context helps.

Checking your work

  • Measure page weight and loading with PageSpeed Insights, which flags oversized images and images without dimensions.
  • Run a technical SEO audit to find missing alt text and broken images across the site.
  • Try the page with a screen reader for a few minutes. It's the fastest way to hear whether your alt text makes sense.

Frequently asked questions

Does alt text help image search rankings?

It helps search engines understand the image, alongside the filename, surrounding text and page topic. Write it for people first; that's also what helps search.

How long should alt text be?

As long as needed to convey the image's purpose — usually a short sentence. Put longer explanations in the page text.

Should I lazy-load every image?

No. Lazy-load images below the fold. Load the main above-the-fold image normally.

Next step

Pick your most visited page, check every image for dimensions, a sensible size and meaningful (or deliberately empty) alt text, and fix the largest image first.

Illustration of a structured hierarchy of URL cards branching from a single sitemap root

Technical SEO

How to Create an XML Sitemap for a Website

An XML sitemap tells search engines which pages you want found. Here's what to include, how to structure it for large sites, and how to keep it accurate.

5 min read