Images that do not slow you down
Five things to do to every image before it goes on a page, why size matters most, and when lazy loading makes a page slower instead of faster.

Most advice about images and SEO starts with keywords in the alt text. That's the least of it. The thing that decides whether an image helps or hurts a page is how much of it you send, and most images go on websites exactly as they came off a phone or out of a stock library.
There are five things worth doing to every image before it goes up, and two decisions about where it sits on the page. None of them needs special software, and the first one usually does more than the rest put together.
Most of the gain is in one number#
A modern phone takes photographs several thousand pixels wide. A typical content column on a website is well under a thousand. Put the photo on the page as it is and every visitor downloads all of those pixels, and their browser shrinks the picture back down to fit. They pay for the full photo and see a small one.
It matters for search because of Largest Contentful Paint, one of Google's Core Web Vitals: the time it takes for the biggest thing in view to appear. On many pages that's an image, often the large one at the top. Google counts 2.5 seconds or less as good. A heavy hero image is one of the most common reasons a page misses it, and how much speed affects ranking is a fair question with a measured answer. Speed is a small ranking signal. It's a much bigger factor in whether people wait for the page at all.
Five things to do before an image goes on a page#
Resize it to the size it's shown at. Find the widest the image will ever appear on your site, in pixels, and export it at about twice that, so it stays sharp on high-resolution screens without carrying pixels nobody sees. Then compress it: most images can lose a lot of file size before anybody notices, and a free tool like Squoosh, which resizes and compresses in your browser, lets you compare the before and after side by side. If the same image appears at very different sizes, on a phone and on a wide screen, the srcset attribute lets you offer several versions and the browser picks the one that fits. Most content management systems, WordPress included, make these versions for you when you upload.
Give it a width and a height. Put width and height attributes on every <img>, set to the image's real proportions. Without them, the browser doesn't know how much room to leave until the file arrives, so the text below jumps down the page as each picture loads. Google measures that jump as Cumulative Layout Shift, another Core Web Vital, and it's the reason people tap the wrong link on a page that's still loading. With the attributes in place, browsers work out the shape in advance and keep the space free, even when your stylesheet makes the image responsive, as long as it also sets height: auto (most themes already do).
Save it as WebP or AVIF. These two formats make smaller files than JPEG and PNG at the same visible quality, and both work in all current major browsers: WebP for years, and AVIF since Microsoft Edge added it in early 2024. Google Search indexes both. AVIF usually comes out smaller, and takes longer to make, so whether AVIF is worth switching to depends on how you produce your images. If you need to support older devices, the <picture> element lets you offer AVIF or WebP with a JPEG behind it. Logos, icons and line drawings are usually better as SVG, which stays sharp at any size.
Write alt text for the person who can't see it. The alt attribute is the description a screen reader reads out in place of the image, and it's what shows if the image fails to load. The accessibility standard WCAG requires it for any image that carries meaning. Write it for somebody listening to the page, and it'll do everything search needs from it too. Say what the image shows and why it's there, in a short phrase: "Dalmatian puppy playing fetch" is the example in Google's own image guidelines, which also warn against stuffing the attribute with keywords. Leave out "image of", because the screen reader already says it's an image. Purely decorative images, a divider or a background flourish, should have an empty alt="" so screen readers skip them.
Name the file for what it shows. Google's guidelines say the file name gives it a clue about the image's subject, and give my-new-black-kitten.jpg as better than IMG00023.JPG. It's a small signal and it takes seconds: a few lower-case words joined by hyphens, before you upload. Renaming files that are already live changes their address, which breaks anything linking to them, so do it for new images rather than going back through old ones.
Alt text is written for somebody who can't see the picture. Everything it does for search follows from that.
Lazy load below the fold, never above it#
Lazy loading means the browser waits to fetch an image until the visitor scrolls near it. Adding loading="lazy" to an <img> is all it takes, every current browser supports it, and Google can index images loaded this way. WordPress has added it to images automatically since version 5.5, in 2020.
Used further down a long page, it saves visitors downloading pictures they may never scroll to. Used on the first image in view, it does the opposite. A lazy-loaded hero image is a slower hero image, because the browser holds it back until it has worked out the layout, then starts fetching the very thing the visitor is waiting for. Google's web.dev guidance says plainly not to lazy load images in the first visible part of the page.
For that first large image, do the reverse: leave loading="lazy" off and add fetchpriority="high", which tells the browser to fetch it ahead of less urgent files. The pros and cons of lazy loading covers the edge cases, including what happens when a script rather than the browser does the loading.
Help image search find the pictures worth finding#
Google Images is a search engine in its own right, and for some businesses it sends real visitors: anybody whose work is visual, from kitchens to wedding cakes to garden design. A few things decide whether your pictures show up there.
Use an <img> element. Google's guidelines say it finds images in the src of an <img> and doesn't index images set as CSS backgrounds. A photo that matters belongs in the page, not in the stylesheet.
Put it next to the words about it. Google works out what an image shows partly from the text around it, the heading above it and any caption. A picture of your shopfront beside a paragraph about where you are tells Google far more than the same picture in a gallery with no words at all.
Use your own photographs. A stock photo appears on hundreds of other sites, so there's little reason for image search to send anybody to yours for it. A photograph of your own work, premises or people exists only on your site. Why your own photographs beat better stock makes the case beyond search.
An image sitemap, a list of your images for search engines, is optional. It helps most when images are loaded in ways a crawler might miss, or are kept on a separate domain such as a content delivery network.
In summary#
Resize every image to about twice the size it's shown at, give it a width and height, save it as WebP or AVIF, write alt text for someone who can't see it, and name the file for what it shows. Lazy load the images further down the page and never the first one in view. The first of those does most of the work.
To see what your images are costing a page, run it through our free speed test. It breaks the page's weight down by type, pictures included, and times its Largest Contentful Paint from several continents. Our SEO plans repeat checks like these for you: speed every day, and your pages for problems every week.


