Blog / WordPress /

Image SEO on WordPress: file names, alt text and size

Open almost any slow WordPress page and look at what’s being loaded. Nine times out of ten, the heaviest things on it are images, and the images are called something like IMG_4821.jpg and weigh more than the rest of the page put together.

Images are easy to neglect because they look fine. They’re also one of the easiest places to make a site faster and easier to find. Three things matter most: size, file names and alt text.

1. Size: the one that affects everyone

Resize before you upload

A photo straight off a phone or camera can be 4,000 pixels wide and several megabytes. Your blog’s content area is probably under 1,000 pixels wide. That extra size gets downloaded by every visitor and never seen.

WordPress creates smaller copies of each image you upload, and since version 5.3 it scales down very large uploads to 2,560 pixels. That helps, but it’s still much bigger than most pages need, and the original stays on your server.

My habit: resize to roughly twice the width it’ll be displayed at (for sharp screens), then upload. For a typical blog post, 1,600–2,000 pixels wide is plenty.

Compress

Resizing reduces the pixels; compression reduces the file size for those pixels. Free tools like Squoosh do it in the browser, or a plugin can compress on upload. A good photo can usually lose half its weight or more with no visible difference.

Use a modern format where you can

WordPress has supported WebP uploads since version 5.8. WebP files are usually noticeably smaller than JPEGs at similar quality. Many optimisation plugins can create WebP versions automatically and serve them to browsers that support them.

Let lazy loading do its job, except at the top

WordPress adds loading="lazy" to images by default, so images further down the page only load when someone scrolls towards them. That’s good.

The exception is the main image at the top of the page. If it’s lazy-loaded, the browser waits before fetching the very thing visitors see first, which can make the page feel slower. Recent WordPress versions try to skip lazy loading for the first image, but themes and page builders don’t always cooperate. Check your hero images.

Set width and height

Images without width and height attributes make the page jump around as they load, because the browser doesn’t know how much space to save. That’s what Core Web Vitals measures as CLS (Cumulative Layout Shift). Images added through the block editor normally get these attributes. Images in custom theme code sometimes don’t.

2. File names: small, quick, often skipped

IMG_4821.jpg tells nobody anything. watercolour-brush-sizes.jpg tells Google, and anyone who downloads the image, what it shows.

  • describe the image in a few words
  • use hyphens between words
  • lowercase
  • rename before uploading. Renaming afterwards is fiddly, and the old URLs may already be in use.

This won’t transform your rankings on its own, but it’s free and takes seconds.

3. Alt text: write it for people first

Alt text is read aloud by screen readers to people who can’t see the image. It’s shown when an image fails to load. And search engines use it to understand what an image is.

Write it for the first group and you’ll naturally serve the others.

Good alt text:

  • describes what’s in the image and why it’s there
  • is short, usually a sentence or less
  • doesn’t start with “image of” (screen readers already announce it’s an image)

Examples:

  • ❌ alt="brush"
  • ❌ alt="best watercolour brushes watercolour brush set cheap brushes"
  • ✅ alt="Three round watercolour brushes in sizes 2, 6 and 12 side by side"

Purely decorative images, such as a divider or a background texture, should have empty alt text (alt="") so screen readers skip them. In the block editor, leaving the alt text field blank does this.

Captions and context help too

Search engines look at the text around an image, not just its attributes. An image placed next to the paragraph it illustrates, with a caption where useful, is easier to understand than a gallery of unlabelled photos at the bottom of a post.

Fixing an existing site

If you’ve got years of unoptimised images, don’t try to fix everything at once:

  1. Run your most important pages through PageSpeed Insights. It lists the heaviest images.
  2. Use an optimisation plugin to bulk-compress the media library (take a backup first).
  3. Add alt text to images on your top pages by hand. Bulk tools that “auto-fill” alt text from file names usually produce rubbish.
  4. Build the habits above into how you upload from now on.

A checklist for every upload

Go and look at your last five uploads. How many are still called IMG_something? No judgement. Mine used to be too.