SEO guide

Image SEO guide: make your images load fast and get found in search

Images are the heaviest part of most pages. A well-prepared image brings visitors from Google Images, speeds up the page and stands out when shared; a careless one slows the page down, shifts the content and tells screen reader users nothing. This guide walks you through every step, from alt text to lazy loading, with code examples.

12 min readUpdated: November 9, 2026

In short

  • Give every content image short alt text that says what it shows; leave alt="" on decorative images. A missing attribute and an empty one are not the same thing.
  • Put the image's real width and height on the <img> tag; the browser reserves its space in advance and the content doesn't shift.
  • Serve photos as WebP or AVIF, sized for how they appear on screen: srcset and sizes send phones a small file and wide screens a large one.
  • Lazy-load below-the-fold images with loading="lazy"; never lazy-load the main image on the first screen, give it fetchpriority="high" instead.
  • Google finds images through the <img> tags in your HTML; CSS background images are not indexed in Google Images.

How does Google find and understand images?

To index an image, Google first crawls the page that contains it. It reads the image URL from the src and srcset attributes of the <img> tag; images inside <picture> are found the same way. According to Google's documentation, images set with background-image in CSS are not indexed. Serve every image you want found in search as an <img>.

To understand what an image is about, Google combines several sources:

  • Alt text: the short description that stands in for the image. Google's image documentation says it uses alt text together with the page content to understand what an image is about.
  • Page content: the headings and text near the image; place the image in the section that covers its subject.
  • File name and URL: mavi-seramik-kupa.jpg ("blue ceramic mug") says far more than IMG_4821.jpg.
  • Structured data: the image property in product, recipe and article markup tells Google which product or post the image belongs to (structured data guide).

According to Google's documentation, Google Images supports BMP, GIF, JPEG, PNG, WebP, SVG and AVIF. For an image to be indexed, both the page and the image file must be crawlable. If the image lives on a CDN, that domain's robots.txt must allow images too.

Google's Discover documentation recommends images at least 1200 pixels wide and the max-image-preview:large permission in the robots meta tag.

How do you write alt text? Good and bad examples

Alt text (the alt attribute) is shown in place of an image that fails to load, read aloud by screen readers and tells search engines what the image is about. Good alt text is written as if you were describing the image over the phone to someone who can't see it: what does it show, and why is it on this page?

ImageWeak alt textBetter alt text
Product photo“mug”“Handmade blue-glazed ceramic mug, side view”
Second photo of the same product“mug, ceramic mug, cheap mug, mug prices”“Close-up of the blue ceramic mug's handle and glaze texture”
Chart“chart”“Orders by month; the busiest month is December”
Logo used as a link“logo”“Example Store home page”
Campaign image with text“banner1”“Free shipping on all ceramics throughout November”
  • Keep it short and concrete. Google doesn't publish a length limit, but screen readers read the whole text. One sentence is enough for most images.
  • Don't start with "image of" or "picture of". The screen reader already says it's an image.
  • Don't list keywords. Google's image documentation warns that stuffing alt text with keywords can cause your site to be seen as spam.
  • Repeat any text in the image in the alt text. Where possible, don't bake important information into an image; put it in the page text.
  • For linked images, describe the destination. If the image is the link's only content, its alt text acts as the link text.

Decorative images and empty alt text

Dividers, patterns and icons placed next to text that gives the same information carry no content. Give them alt=""; the screen reader skips the image. Leaving the attribute out entirely is different: many screen readers then read out the file name.

<img src="/gorseller/mavi-seramik-kupa.webp" alt="El yapımı, mavi sırlı seramik kupa" width="800" height="800">
<img src="/gorseller/ayirici-dalga.svg" alt="" width="1200" height="24">

Röntgen's page audit respects this distinction. The "Images without alt text" warning in the On-page category counts only images with no alt attribute at all and shows a ratio such as "3 / 12 images"; images with alt="" are not counted as missing. If every image has the attribute, you'll see "Images have alt text". The audit can't judge quality; it's up to you to check that the alt text really describes each image.

File names and image URLs

According to Google's documentation, the file name gives a clue about what the image shows. Change camera names such as IMG_4821.JPG or DSC00012.jpg before uploading:

  • use lowercase and separate words with hyphens: mavi-seramik-kupa.jpg; avoid spaces and underscores,
  • convert Turkish characters to their Latin equivalents (c for ç, s for ş and so on); encoded character sequences in a URL are unreadable. The URL slug generator does this for you,
  • keep the name short; three to five words are enough, don't turn it into a keyword list,
  • if you prepare separate images for different language versions, translate the file names too; Google recommends this.

Keep image URLs stable; when an image's URL changes, it takes time for it to be rediscovered and for its signals to carry over. When you migrate the site or move images to a new CDN, redirect the old image URLs with a 301 too (redirect guide). Don't use URLs that change on every load; versioned names that change only when the file changes (kupa.3f9a2c.webp) are fine.

See images with missing alt text, missing dimensions and wrong lazy loading in a single report.

Page audit

Dimensions: width, height and layout shift

A browser can't know an image's size before downloading it. If the <img> tag has no width and height, it reserves no space at first and, once the image arrives, pushes everything below it down. This shift counts towards the CLS (Cumulative Layout Shift) metric of Core Web Vitals and makes readers tap the wrong spot.

Use the image's real pixel size, or any size with the same aspect ratio. Modern browsers compute the aspect ratio from these two numbers and reserve the space; height: auto in CSS keeps the image responsive:

<img src="/gorseller/mavi-seramik-kupa-800.webp" width="800" height="600" alt="El yapımı, mavi sırlı seramik kupa">

img { max-width: 100%; height: auto; }
.urun-kart img { aspect-ratio: 1 / 1; object-fit: cover; }

The last line keeps product card images in a square box; object-fit: cover crops the image without squashing it.

What does Röntgen report?

  • "Images without dimensions" (Performance): appears when at least three images in the HTML lack a width or height attribute, with a ratio such as "5 / 14 images".
  • "Images display with distorted proportions" (Mobile): lists images that Lighthouse measured as drawn at a different aspect ratio than their own, i.e. squashed or stretched. The fix is to give dimensions matching the file's real ratio, or to crop with object-fit: cover.
  • Layout shift finding (Performance): shows the page's CLS; 0.1 or less is good, above 0.25 is poor. For other causes of layout shift, see the Core Web Vitals guide.

WebP, AVIF and compression: which format when?

FormatUsed forNote
JPEGPhotosOpens everywhere; larger than WebP and AVIF at the same quality.
PNGGraphics that need transparency, screenshotsLossless; produces very large files for photos.
WebPPhotos and graphics, transparency, animationSupported by all current browsers; can compress lossy or lossless.
AVIFPhotos, especially large hero imagesUsually smaller than WebP at the same quality; slower to encode.
SVGLogos, icons, flat-colour illustrationsVector-based, stays sharp at any size; not suitable for photos.
GIFOld-style animationsFor animation, video (MP4, WebM) or animated WebP is much smaller.

If you want a fallback for older browsers, use <picture>. The browser picks the first source it supports and, if it supports none, downloads the JPEG in <img>. The alt text and dimensions stay on the <img> tag:

<picture>
  <source type="image/avif" srcset="/gorseller/kupa-800.avif">
  <source type="image/webp" srcset="/gorseller/kupa-800.webp">
  <img src="/gorseller/kupa-800.jpg" width="800" height="600" alt="El yapımı, mavi sırlı seramik kupa">
</picture>

Compression and metadata

The quality setting matters as much as the format. With lossy compression, lower the quality step by step and compare the image at the size it will be displayed; pick the lowest setting where you see no difference. For batch conversion, Google's cwebp tool and open-source command-line tools such as avifenc do the job:

cwebp -q 80 kupa.jpg -o kupa.webp
avifenc -q 60 kupa.jpg kupa.avif

The EXIF data in phone photos can even contain the coordinates of where the photo was taken. Strip this data before publishing; if you want to keep copyright and licensing information, keep only those fields (IPTC) — Google can show them in image search.

Röntgen's format findings

When a PageSpeed Insights measurement is available, the page audit derives the "Images are not optimized" finding from Lighthouse's image delivery analysis: if the estimated total saving from modern formats, compression and correct sizing exceeds 50 KB, it warns and lists the files with the biggest gains. If the saving is below that, it says "Images are delivered efficiently". Without a measurement, the audit looks at file extensions in the HTML: if there are at least three JPEG, PNG, GIF, WebP or AVIF images identifiable by extension and the legacy formats are in the majority, the "Images use legacy formats" warning appears; images with a WebP or AVIF source inside <picture> count as modern.

If your image service picks the format based on the browser's Accept header, the browser may receive WebP even when the URL ends in .jpg; a warning based on extensions is then misleading. You can see the format actually downloaded in the browser's network panel, in the response's Content-Type header.

Responsive images: srcset, sizes and picture

Downloading a 2000-pixel file for an image shown 360 pixels wide on a phone delays the main content and wastes mobile data. srcset tells the browser which widths of the same image exist, and sizes how much space the image will take on screen. The browser then picks the best file for the screen width and pixel density:

<img src="/gorseller/kupa-800.webp"
     srcset="/gorseller/kupa-480.webp 480w,
             /gorseller/kupa-800.webp 800w,
             /gorseller/kupa-1200.webp 1200w"
     sizes="(max-width: 600px) 100vw, 50vw"
     width="1200" height="900"
     alt="El yapımı, mavi sırlı seramik kupa">
  • 480w is the file's actual pixel width, not its size on screen.
  • Without sizes, the browser assumes the image fills the whole screen width and may pick a larger file than needed. Set the value according to your actual layout.
  • For fixed-size images such as logos, use density descriptors: srcset="/logo.png 1x, /logo@2x.png 2x".
  • Always include the src attribute. Clients that don't support srcset use it, and Google's documentation also recommends providing a fallback URL.

When do you need picture?

If only the size changes, srcset is enough. If you want to show a different crop on phones, for example a vertical close-up instead of a wide landscape, give the <source> elements inside <picture> a media attribute. If the crops have different aspect ratios, give each <source> its own width and height; the browser then reserves the right space on every screen.

Lazy loading and the LCP image

loading="lazy" tells the browser not to download an image until it gets close to the viewport. On a long category page, deferring dozens of images below the fold leaves bandwidth for the files the first screen needs. The rule is simple: lazy loading is only for images below the first screen.

On most pages, the main image on the first screen is the Largest Contentful Paint (LCP) element. If it is lazy-loaded, the browser requests it only after working out the page layout, and LCP is delayed. Give the main image fetchpriority="high" instead; the browser downloads it before the other images:

<img src="/gorseller/kampanya-1200.avif" width="1200" height="600" alt="Kış koleksiyonundaki seramik kupalar" fetchpriority="high">

<img src="/gorseller/urun-12.webp" width="400" height="400" alt="Yeşil sırlı seramik tabak" loading="lazy">

JavaScript lazy-loading libraries usually keep the URL in a data-src attribute and load the image on a scroll event. Googlebot, however, doesn't scroll or click like a user. Google's lazy-loading documentation recommends loading content when it enters the viewport, using the browser's built-in lazy loading or IntersectionObserver.

Röntgen's lazy-loading findings

Because the raw HTML doesn't reveal which image is on the first screen, the page audit uses document order:

  • "Above-the-fold image is lazy-loaded": appears when the page's first image, or an image marked with fetchpriority="high", has loading="lazy" or keeps its URL in data-src instead of src. Remove the attribute, put the URL in src and add fetchpriority="high".
  • "Images aren't lazy-loaded": if the page has at least six images, the first three are treated as being on the first screen; if fewer than a quarter of the rest are lazy-loaded, a warning appears with a ratio such as "1 / 9 images lazy-loaded".
  • "Images are lazy-loaded": the images further down are deferred and the first image loads right away; nothing to do.

With a PageSpeed measurement, the LCP finding also names the LCP element Lighthouse found and, if the time isn't good, gives advice based on the longest phase. A long resource load delay means the browser discovers the image late; a long resource load duration means the file is large.

Image sitemaps and Google Images

Google finds most images while crawling pages; an image sitemap is an extra way to discover them. It is especially useful for images in galleries loaded with JavaScript. In 2022 Google deprecated tags such as image:caption and image:title; today you write only image:loc for each image, and a single <url> entry can hold up to 1,000 images:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
  <url>
    <loc>https://www.magaza-ornek.com/urun/mavi-seramik-kupa</loc>
    <image:image>
      <image:loc>https://cdn.magaza-ornek.com/gorseller/mavi-seramik-kupa-1.webp</image:loc>
    </image:image>
    <image:image>
      <image:loc>https://cdn.magaza-ornek.com/gorseller/mavi-seramik-kupa-2.webp</image:loc>
    </image:image>
  </url>
</urlset>

You can add image entries to your regular sitemap or keep them in a separate file. Check the sitemap's format and the responses of its URLs with the Sitemap validator; all the sitemap rules are in the XML sitemap guide.

If you don't want an image to appear in search

To remove images from Google Images, block Google's image crawler from that folder in robots.txt; the page itself stays in search:

User-agent: Googlebot-Image
Disallow: /ozel-gorseller/

For individual files, you can add an X-Robots-Tag: noindex header to the image response; for all the images on a page, use the noimageindex value in the robots meta tag. Check the opposite too: confirm with the robots.txt tester that you haven't accidentally blocked the folder holding your product images.

Share image: og:image

When a page is shared on WhatsApp, LinkedIn, Facebook or X, the preview image comes from the og:image tag. This image doesn't affect rankings, but it is decisive for whether the link gets clicked. Google's image documentation says you can indicate your preferred thumbnail for search results with structured data or og:image; this is a preference, not a guarantee.

<meta property="og:image" content="https://www.ornek-site.com/gorseller/paylasim/gorsel-seo.jpg">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="Görsel SEO kontrol listesi">
<meta name="twitter:card" content="summary_large_image">
  • 1200 × 630 pixels (about 1.91:1) appears as a large card on the major platforms. Keep important text and logos in the centre of the image; some platforms crop the edges.
  • The URL must be an absolute address starting with https://; social networks don't resolve relative URLs against the page address.
  • Use JPEG or PNG. SVG isn't shown in previews; WebP works on the major platforms but may not appear in some apps.

In the Social category, Röntgen's page audit shows the "Open Graph image missing", "og:image is not an absolute URL" and "Share image dimensions missing" findings. To see whether the image can actually be downloaded, its pixel size, its format and how it looks on each platform, use the Social media preview tool.

Check how your share image looks on Facebook, X, LinkedIn and WhatsApp.

Social media preview

CDNs, image services and WordPress

Image CDNs serve files from a server close to the visitor; most also resize and compress images and convert them to a format the browser supports. Watch out for three things:

  • Stable URLs: if you use your own subdomain (cdn.ornek-site.com), image URLs stay the same when you switch providers.
  • Caching: give images a long cache lifetime (Cache-Control: max-age=31536000, immutable) and change the file name when the file changes. You can see the setting by checking an image URL with the HTTP header checker.
  • Format selection: if the format is chosen based on the Accept header, the CDN must send Vary: Accept in the response or split its cache by format. Otherwise an AVIF file prepared for one browser may be served to another browser that can't open it.

Image SEO in WordPress

  • WordPress generates several smaller copies of each image and adds the srcset and sizes attributes to images in your content itself; by default it scales very large uploads down to 2560 pixels.
  • You can upload WebP images since version 5.8 and AVIF images since 6.5; for AVIF, the image processing library on your server must support the format.
  • The alternative text field in the media library is the alt attribute; the image's title and description fields don't replace alt text.
  • Since 5.5, WordPress adds loading="lazy" to images automatically; since 6.3 it tries to exclude the first images and to add fetchpriority="high" to the likely LCP image. If your theme or page builder shows the main image in its own slider, this guess may fail; verify the result with a page audit.

Step-by-step image SEO checklist

  1. Audit the page and note the image findings in the Page audit report.
  2. Fix the LCP image: an <img> in the HTML, not lazy-loaded, with fetchpriority="high".
  3. Write alt text; give decorative images alt="".
  4. Rename files: descriptive, lowercase and hyphenated.
  5. Add dimensions: real width and height, height: auto in CSS.
  6. Fix the format: photos in WebP or AVIF, logos in SVG; EXIF data removed.
  7. Serve responsively: srcset and a correct sizes on large images.
  8. Set up lazy loading: loading="lazy" only on images below the first screen.
  9. Confirm crawlability: robots.txt must not block images or the CDN; add an image sitemap if needed.
  10. Define the share image: absolute URL, 1200 × 630 pixels, dimensions specified.
  11. Measure the result. Real-user data covers the last 28 days, so changes in LCP and CLS settle in over a few weeks.

Frequently asked questions

How many characters should alt text be?

Google doesn't publish a character limit. One short sentence that describes the image is enough for most images; because screen readers read the whole text, don't add unnecessary detail or keyword lists.

Should decorative images have alt text?

No, but leave the attribute empty: alt="". Empty alt text tells the screen reader to skip the image; if you leave the attribute out, some screen readers read out the file name. Röntgen's page audit doesn't count empty alt text as missing.

Should I use WebP or AVIF?

Both work in current browsers. AVIF produces smaller files for most photos but is slower to encode; WebP is faster to produce and has wider tool support. AVIF for large hero images and WebP for the rest is a good start; you can also provide a JPEG fallback with the picture element.

Does lazy loading hurt SEO?

The browser's built-in loading="lazy" is not a problem for Google. The harm comes when the main image on the first screen is lazy-loaded (LCP is delayed) or when images load only on scroll or click (Googlebot doesn't scroll or click).

Do I need an image sitemap?

If your images are in the HTML as img tags, Google finds them while crawling the page; a sitemap isn't required. It is an extra discovery route for galleries loaded with JavaScript and for sites with many product images.

What size should og:image be?

1200 × 630 pixels (about 1.91:1) appears as a large preview on the major platforms. Write the URL as an absolute address starting with https://, add the og:image:width and og:image:height tags and use JPEG or PNG.

Related guides and tools