Herozite is a digital marketing agency in San Juan, Puerto Rico. We build websites, grow search traffic, and run campaigns for businesses in Puerto Rico and across the US.

Latest from the blog

Av. de Diego, Puerto Nuevo, San Juan

+1 (787) 605-7114

herozitesolutions@gmail.com

Illustration of four framed photos arranged in a gallery layout

Strategic Use of Images in Search Engine Optimization

,

Web Design, SEO, Local SEO, PPC Management, Social Media Marketing, Conversion Optimization, Content Strategy

Illustration of four framed photos arranged in a gallery layout
Make images easy for Google to find Image SEO basics: 7 supported formats; 1,000 images per URL; 20B+ Lens searches/mo; 1 URL per image. Indexed source: img src attribute.

Quick answer

Image SEO is the work of helping Google find, understand, and show the pictures on your pages. Google picks up images from the src attribute of HTML img elements, then reads the alt text, file name, caption, and nearby text to decide what each one shows. Images added only as CSS backgrounds are not indexed at all.

The technical side is a short list. Use a supported format such as WebP or AVIF, serve responsive sizes with srcset, lazy-load only images below the fold, list hard-to-find images in an image sitemap, and add structured data where your page type supports it. Google says Lens handles more than 20 billion visual searches a month, so camera searches can surface these images too.

  • Discovery: Google indexes images in img elements, and it does not index CSS background images.
  • Meaning: Alt text is the most important image attribute, followed by the file name and the surrounding text.
  • Delivery: Modern formats, srcset, and smart lazy loading keep images fast without hiding them from Google.

Most small business sites we audit treat images as decoration. The photos are there, but they’re named IMG_4471.jpg, they have no alt text, and half of them sit in a slider that loads as a CSS background. Google can’t do much with that. A few hours of cleanup usually fixes it, and the fixes are almost all technical.

This guide covers the technical side: how Google discovers images, what it reads, which formats and markup to use, and how to keep image delivery fast. If you want the other half of the story (original photography, product shots, and how image quality affects sales), read our companion post on high-quality images in SEO and conversion rate.

How Google finds and reads your images

Google’s image documentation is direct about discovery: it finds images in the src attribute of img elements, including img elements inside a picture element. It does not index CSS images. That means a hero photo set with background-image in your theme’s stylesheet is invisible to Google Images, no matter how good the photo is. If an image matters for search, it needs to be a real img element in the HTML.

One smaller rule from the same page: if the same image appears on several pages, reference it with the same URL every time so Google can cache it.

Diagram: how Google finds and reads your images, in three steps. 1, finds it: images in a real img src, including inside picture, are indexed; CSS background images are not; use the same URL for the same image on several pages; lazy-load scripts that wait for a scroll or click hide images, because Google Search does not scroll or click. 2, understands it: alt text is the most important attribute, for example “Technician replacing a split AC unit on a rooftop in Guaynabo” instead of “AC” or “image1”; a file name like my-new-black-kitten.jpg beats IMG00023.JPG; the title, headings, captions, and nearby paragraph add context. 3, shows it: Google Images; structured data can make images eligible for badges; Google Lens handles more than 20 billion visual searches a month; point Google to a preferred image with primaryImageOfPage or og:image.

Alt text

Google calls alt text the most important attribute for providing image metadata. Describe the photo plainly: “Technician replacing a split AC unit on a rooftop in Guaynabo” tells Google and screen reader users far more than “AC” or “image1.” Use your keyword only when it describes the picture. Google warns that stuffing alt text with keywords gives users a poor experience and can get a site treated as spam. Alt text also counts for accessibility, which we cover in the principles of web accessibility.

File names

File names give Google a light clue about the subject. Google’s own example compares my-new-black-kitten.jpg with IMG00023.JPG, and the first one wins. Rename files before you upload them, use hyphens between words, and keep names short. If you publish a Spanish version of a page with its own images, translate those file names as well. Google specifically recommends localizing file names when you localize images.

Placement, captions, and nearby text

Google also pulls meaning from the page around the image: the title, headings, captions, and the paragraph next to it. Put the image near the text it supports, on a page that’s actually about that subject. A photo of a finished kitchen remodel belongs on your kitchen remodeling page, with a caption naming the neighborhood and the work done.

Choosing an image format

Google Search supports BMP, GIF, JPEG, PNG, WebP, SVG, and AVIF images. The file extension should match the actual file type. For most business sites, the practical choice comes down to four of them.

FormatBest forWhat to know
JPEGPhotos when you need maximum compatibilityThe most common web format. Fine as a fallback, but usually heavier than WebP or AVIF at the same quality.
WebPPhotos and graphics on most sitesSupports lossy and lossless compression plus PNG-style transparency. Typically smaller than a JPEG of comparable quality.
AVIFLarge photos where every kilobyte countsBuilt on the AV1 video codec and designed to be smaller than JPEG or WebP. Serve it with a fallback for older browsers.
SVGLogos, icons, and simple illustrationsVector, so it stays sharp at any size. For inline SVGs, add a title element so screen readers get a description.

Responsive images and lazy loading

A phone doesn’t need the 2,400 pixel wide photo your desktop layout uses. The srcset and sizes attributes let you list several widths of the same image and let the browser choose. The picture element goes further, letting you offer AVIF first, WebP second, and JPEG last. Google’s guidance has one firm rule here: always include a regular src on the img element as a fallback, because some browsers and crawlers don’t understand srcset or picture.

Lazy loading delays offscreen images until the visitor scrolls near them. Modern browsers do this natively when you add loading=”lazy” to an img element, with no script required. Use it for images further down the page and leave it off the main image at the top. The web.dev team is clear that images likely to be in view on load, especially the Largest Contentful Paint image, should not be lazy-loaded. Also set width and height attributes on every img element so the browser can reserve space and the layout doesn’t jump.

One warning about older JavaScript lazy-load plugins: Google Search doesn’t scroll or click on your page. If a plugin only loads images after a scroll event, Google may never see them. Google lists browser built-in lazy loading among the methods that don’t depend on user actions, so the native attribute is the safer choice.

Image sitemaps

An image sitemap tells Google about images it might not find on its own, such as images loaded by JavaScript. You can add image entries to your existing sitemap. Each page URL can list up to 1,000 images, and the only required tags are image:image and image:loc. Google has dropped the old caption, title, geo_location, and license tags from its documentation, so there’s no need to fill them in. Images hosted on a CDN or another domain are allowed, as long as you verify both domains in Search Console.

Structured data, preferred images, and licensing

When a page has several images, you can tell Google which one represents it. Google lists three ways: the schema.org primaryImageOfPage property, the image attached to the page’s main entity, or the og:image meta tag. Pick a relevant, high-resolution image and avoid logos, images full of text, and extreme aspect ratios. For Google Discover, Google asks for images at least 1,200 pixels wide and the max-image-preview:large setting.

Structured data for products, recipes, articles, and similar types can also make images eligible for rich results and badges in Google Images. If you own original photos and license them, image license metadata can earn a Licensable badge. You can add it with structured data on the page or with IPTC photo metadata embedded in the file. For structured data, contentUrl plus at least one of creator, creditText, copyrightNotice, or license is required, and the license property is needed for the badge itself.

Google Images and Google Lens

Lens adds another way in: people point a camera at a product, a plant, or a storefront and search with the picture. Google reported more than 20 billion Lens visual searches a month. Clear, original photos of your actual products, menu items, and location, with accurate alt text and captions, give those searches something to match. A stock photo that appears on 5,000 other sites gives them nothing that points to you.

Image SEO do’s and don’ts

DoDon’t
Use real img elements for images that matter in searchPut key photos in CSS backgrounds or sliders that Google can’t index
Write specific alt text that describes what’s in the photoStuff alt text with keywords or repeat the page title
Rename files with short, descriptive, hyphenated namesUpload camera names like IMG_4471.jpg or image1.jpg
Serve WebP or AVIF with srcset and a src fallbackShip one huge JPEG to every screen size
Lazy-load images below the foldLazy-load the hero image or the LCP image
Set width and height on every img elementLet images push content around while they load
List JavaScript-loaded images in an image sitemapFill in the deprecated caption, title, or license sitemap tags
Mark a representative image with og:image or schemaUse your logo as the preferred image for every page

A 20-minute image audit you can run today

  1. Open your three most important pages and right-click the main photo. If you can’t open the image in a new tab, it’s probably a CSS background, so move it into an img element.
  2. Run each page through PageSpeed Insights and note which image is flagged as the Largest Contentful Paint element.
  3. Check the alt text on every image with a browser extension or by viewing the page source. Rewrite empty or generic ones.
  4. Look at the file names in your media library. Rename the ones on key pages before reuploading.
  5. Confirm your images serve as WebP or AVIF, and that phones receive a smaller file than desktops.
  6. Make sure loading=”lazy” is missing from the top image and present on images further down.
  7. In Search Console, open the Performance report and filter Search type to Image to see which images already earn clicks.

Get help with your image setup

Most of these fixes live in your theme or CMS settings, which is where small sites tend to get stuck. Our SEO services cover image indexing, sitemaps, and structured data, and our web development team can rebuild templates that rely on background images. If you want help with any of this, tell us about your project.

Sources

Frequently asked questions

Does Google index background images set in CSS?

No. Google’s image documentation states that it doesn’t index CSS images and finds images through the src attribute of img elements. If a photo should appear in Google Images or support the page’s ranking, place it in the HTML as an img element.

How long should alt text be?

Google doesn’t set a character limit for alt text. It asks for useful, information-rich descriptions that use keywords naturally and fit the page’s context. In practice, one clear sentence describing what the image shows is enough for most photos.

Should I convert all my images to WebP or AVIF?

For photos, yes in most cases, because both formats are typically smaller than JPEG at similar quality. Google Search supports both. If you serve AVIF, use the picture element with a WebP or JPEG fallback so older browsers still display the image.

Do I need a separate image sitemap?

Not necessarily. You can add image tags to your existing sitemap, or create a separate one if that’s easier to manage. It’s most useful for images Google might not discover on its own, such as those loaded with JavaScript, and each page URL can list up to 1,000 images.

Can lazy loading hurt image SEO?

It can if it’s set up badly. Native lazy loading with the loading attribute is fine for images below the fold, but the main image at the top should load normally. Avoid older scripts that wait for a scroll event, because Google Search doesn’t scroll or click on pages.

Want help putting this into practice? Let’s talk

Contact form

    By sending this form, you agree that we may contact you about your request. See our Privacy Policy.