Image SEO in WordPress: Alt Text and File Names

Good alt text and clear file names help search engines and AI assistants understand your images. Here's how to set both up in WordPress, step by step.

By The AutoXSEO Team · · 5 min read

Laptop showing a WordPress media library of product photos next to a ceramic teapot on a desk

To do image SEO in WordPress, give every useful image a short, descriptive file name before you upload it (like blue-ceramic-teapot.jpg) and write alt text that describes what the picture shows in plain words. That's the core of image alt text WordPress SEO. Search engines can't "see" pictures the way you do, so these two small details tell them what each image is about. They also make your site better for people who use screen readers.

The rest of this guide shows you exactly how to do both, with examples, a quick checklist and the mistakes to avoid.

What alt text is and why it matters

Alt text (short for "alternative text") is a short written description attached to an image. It's hidden on the page, but it does three useful jobs:

  • Accessibility: screen readers read it aloud so visitors who are blind or have low vision know what the image shows.
  • Search understanding: Google and other search engines use it, along with the surrounding text, to work out what an image is and when to show it in image results.
  • A fallback: if an image fails to load, the alt text can appear in its place.

AI assistants and AI search tools also rely heavily on text they can read. Clear descriptions make your pages easier for them to understand. If you're curious about that side of things, our guide on making your website easy for AI assistants to read goes deeper.

How to write good alt text

Think of it this way: if you were describing the image to a friend over the phone, what would you say? Write that, and keep it short.

Illustration of a plumber tightening a pipe under a kitchen sink, used as an example for writing alt text

The simple rules

  • Describe what's actually in the image. Be specific rather than vague.
  • Keep it brief. One short sentence or phrase is usually plenty. Aim for roughly under 125 characters as a general guide.
  • Add context that matters. If the image is a product, mention the type, colour or material.
  • Use your keyword only when it fits naturally. If it doesn't describe the image, leave it out.
  • Skip "image of" or "picture of". Screen readers already announce that it's an image.

Good and bad examples

Imagine a photo of a plumber fixing a kitchen sink:

  • Bad: "plumber" (too vague)
  • Bad: "plumber plumbing plumber near me best plumber cheap plumber" (keyword stuffing)
  • Good: "Plumber tightening a pipe under a kitchen sink"

For a product photo in a shop:

  • Bad: "IMG_4821"
  • Good: "Handmade blue ceramic teapot with a bamboo handle"

How to add alt text in WordPress

You have a few easy places to do it.

In the Media Library

  1. Go to Media in your WordPress dashboard.
  2. Click an image to open it.
  3. Fill in the Alternative Text box on the right.
  4. Save the changes.

In the block editor

  1. Click the image block in your post or page.
  2. Open the settings sidebar on the right.
  3. Type your description into Alternative text.

One thing to know: the alt text you set in the Media Library is a default. Alt text edited inside a post applies to that image placement. Either way, check it before you publish.

Decorative images

If an image is purely decoration (a divider line or background flourish), it doesn't need a description. Leave the alt text empty so screen readers skip it. Don't fill it with keywords just to have something there.

File names: the other half of image SEO

Your camera or phone names photos things like IMG_4821.jpg or DSC00934.png. That tells search engines nothing. Rename the file before you upload it, because changing it later can break links.

How to name image files

  • Describe the image: blue-ceramic-teapot.jpg beats IMG_4821.jpg.
  • Use lowercase letters and separate words with hyphens, not spaces or underscores.
  • Keep it short: three to five words is plenty.
  • Avoid stuffing: one clear name, not a string of keywords.

File name and alt text should agree with each other but don't need to match exactly. The file name is a label; the alt text is a description.

Other image habits that help your SEO

Alt text and file names matter, but a few other basics round things out:

  • Resize before uploading. A 5,000-pixel-wide photo on a page that only shows it at 800 pixels slows your site down. Page speed matters for visitors and for search.
  • Compress images. Smaller file sizes load faster, usually without any visible loss in quality.
  • Use real photos where you can. Original images of your own products, work and team help your pages feel trustworthy and unique.
  • Place images near relevant text. The words around an image help search engines understand it.
  • Add captions only when they help. They're read more often than body text, so use them when they add real information.

If you run a shop, images carry extra weight. Our guides on WooCommerce product page SEO and writing product descriptions that rank show how photos, titles and descriptions work together on a product page.

Fixing the images you already have

If your site already has hundreds of images with no alt text, don't panic. Work through them in order of importance:

  1. Start with your most visited pages: homepage, main service pages and best-selling products.
  2. Fix product and service images next, since these are the ones people search for.
  3. Tackle blog images last, adding alt text as you update older posts.
  4. Don't rename old files that are already in use unless you're prepared to update every place they appear. Alt text is the safer fix.

That's a lot of clicking if your library is big. AutoXSEO for WordPress can write image descriptions across your whole site automatically and explain each change, with one-click undo if you don't like one.

A quick image SEO checklist

  • Descriptive, hyphenated file name before upload
  • Image resized and compressed
  • Alt text that describes the picture in a short phrase
  • Keyword used only where it fits naturally
  • Empty alt text for purely decorative images
  • Image placed close to related text on the page

Get these habits into your routine and every new image you publish will be working for your SEO from day one.

Frequently asked questions

Does alt text help SEO in WordPress?

Yes. Alt text helps search engines understand what an image shows, which can help it appear in image search and supports the page's overall topic. It also makes your site accessible to people using screen readers.

How long should alt text be?

Keep it short and clear, usually one brief sentence or phrase. As a general guide, under about 125 characters works well. Describe what's in the image without padding it with keywords.

Should I put my keyword in every image's alt text?

No. Only use your keyword when it genuinely describes the image. Repeating it in every alt text looks like keyword stuffing and doesn't help readers or search engines.

Do I need to rename image files before uploading to WordPress?

It's a good habit. A descriptive file name like blue-ceramic-teapot.jpg gives search engines an extra clue. Rename before uploading, since renaming later can break the image on pages where it's already used.

What should I do with decorative images?

Leave the alt text empty. That tells screen readers to skip the image, which is better than filling it with a meaningless or keyword-heavy description.

The AutoXSEO Team. This article was planned, written, illustrated and published by AutoXSEO's autopilot — the same way it works on your site — and checked against our quality rules. How AutoXSEO works

Free · 20 seconds · no card

Get articles like this on your own site.

AutoXSEO plans, writes and publishes them for you, and fixes every page while it's at it. Type your address to see what it would do.

Free scan · no card · we detect your platform automatically

Keep reading

WordPress & WooCommerce

How Often Should You Publish Blog Posts for SEO?

There's no magic number of posts per week. Here's how to choose a publishing schedule you can actually keep, and what matters more than frequency.

· 6 min read

WordPress & WooCommerce

Internal Linking for Small Sites: A Simple Plan

Internal linking sounds technical, but it's just connecting your own pages sensibly. Here's a simple plan any small business owner can finish in an afternoon.

· 5 min read

Newsletter

SEO and AI-search tips that work.

What's changing in Google and AI answers, and what to do about it. Two emails a month, no spam.

Unsubscribe any time. Privacy