Images in Search: Alt Text, File Names and Crawlable src URLs
Images help readers understand a page, and they can also appear in image search. Search engines need to find the image file, understand what it shows and know which page it belongs to. Most of that comes from basic HTML practices that also improve accessibility for people using screen readers.
Making image files discoverable
Use a standard img element with the image URL in the src attribute. Images set only as CSS backgrounds are not indexed as images. Lazy loading is fine when the src or srcset is present in the HTML or set as the element enters the viewport, without requiring a click.
Make sure image URLs are not blocked by robots.txt if you want them to appear in image results.
Alt text and file names
Alt text should describe what the image shows in the context of the page, in a short phrase or sentence. It is read aloud by screen readers and shown if the image fails to load. Avoid lists of keywords; they help neither readers nor search engines.
Decorative images that add no information can use an empty alt attribute so assistive technology skips them. Descriptive file names, such as redirect-chain-diagram.png, add a small amount of context compared with names like IMG_0042.png.
<img src="/images/redirect-chain-diagram.png"
alt="Three redirects between an old URL and the final page"
width="800" height="450" loading="lazy">Context and image sitemaps
Place images near the text they illustrate and use captions where they help. The surrounding content and page title give search engines context about the image subject.
For images loaded in ways crawlers may not find, such as through scripts, list them in an image sitemap extension so their URLs are known.