Skip to content

Image SEO: alt text, formats, sizes and lazy loading

Give every image useful alt text, a modern format, the right size and correct lazy loading.

  • Free, no sign-up
  • 1 to 2 hours with an agent
  • By Devvrat Hans
  • Version 1.0, updated Oct 26, 2026

1Your site and stack

Optional. The prompt adapts as you type; leave a field blank and the agent works it out.

2Copy it into your agent

image-seo.md62 lines, about 846 tokens

Paste into any coding agent: Claude Code, Cursor, Codex, Copilot, Windsurf or Cline.

# Image SEO: alt text, formats, sizes and lazy loading

Images are usually the heaviest part of the production site and the part search engines and screen readers understand least. Fix them at the source: the image component, the upload pipeline and the templates, so every image is described, sized and served efficiently.

Site: not given. Find the production URL in the project config, or ask me.

## Ground rules

1. Read before you write. Explore the parts of the codebase this job touches and tell me what is already in place.
2. Plan, then stop. Give me a numbered plan: what you will change, in which files, and why. Wait for my approval before editing anything.
3. Fix things at their source (the shared layout, the config, the generator), not with one-off patches page by page.
4. Keep the project's conventions: its framework APIs, file layout, naming and code style. Add no new dependency without asking.
5. Where something is already done well, say so and leave it alone.

## You will not

- Edit `.env` files, secrets or API keys, or print their values.
- Deploy, push, merge or publish anything.
- Delete data, or run migrations or scripts against a production database.
- Add tracking, third-party scripts or links to any site I did not ask for.
- Change copy, design or behaviour that this job does not need.
- Delete original image files.
- Write alt text that stuffs keywords.

## Your stack

- Framework: Work out the framework, router and build output from the project files (package.json, lockfiles, framework config) before planning, and say which you found.
- Host: Work out where the site is hosted from the config files (vercel.json, netlify.toml, wrangler config, Dockerfile, fly.toml) and say which you found.

## Steps

### 1. Inventory

List where images come from (static files, a CMS, user uploads, a CDN) and how they are rendered (a framework image component, plain `<img>`, CSS backgrounds). Report images with no alt, oversized files, missing width and height, and lazy loading on above-the-fold images.

### 2. Alt text

Meaningful images get alt text that says what they show in context; decorative images get `alt=""`. For dynamic images, build alt text from data (a product's name and what the screenshot shows). Add an alt field to upload forms where users add images.

### 3. Formats and sizes

Serve WebP or AVIF with fallbacks through the framework's image component or the CDN, responsive `srcset` and `sizes`, and source files resized to the largest size actually shown. Set width and height (or aspect ratio) on every image to prevent layout shift.

### 4. Loading

Lazy-load images below the fold; never lazy-load the main above-the-fold image, and give it `fetchpriority="high"`. Use descriptive file names for new images. Add important images to the sitemap if the site depends on image search.

## Done means

- [ ] Every meaningful image has alt text and decorative ones have empty alt.
- [ ] Images are served in modern formats at the sizes shown, with srcset where useful.
- [ ] Every image has width and height or an aspect ratio.
- [ ] Below-the-fold images lazy-load and the hero image does not.

## Report back

When you finish, give me:

- what you changed, file by file;
- anything you skipped, and why;
- anything I must do by hand (DNS records, dashboards, accounts, deploys);
- how to check each change on the live site.

One-line version

For agents that can read a URL. It fetches this prompt with your settings applied.

Read https://abacklaunch.com/prompts/image-seo.md and follow it for this project.

3Check the result

When the changes are live, run these free checks. Add your site URL above and each one opens already running on it.

This prompt will not

  • Edit .env files, secrets or API keys, or print their values.
  • Deploy, push, merge or publish anything.
  • Delete data, or run migrations or scripts against a production database.
  • Add tracking, third-party scripts or links to any site I did not ask for.
  • Change copy, design or behaviour that this job does not need.
  • Delete original image files.
  • Write alt text that stuffs keywords.

It reads your code first, shows you a plan, and waits for your approval before it changes anything.

What you get

  • Alt text for every meaningful image, built from data where possible
  • Modern formats at the right sizes
  • No layout shift from images, and correct lazy loading

How to use this prompt

  1. 1

    Describe your stack

    Add your site, framework and host. The prompt adapts; blank fields are left for the agent to work out.

  2. 2

    Paste it into your agent

    Open your project in Claude Code, Cursor, Codex, Copilot, Windsurf or Cline, and paste the prompt or the one-line version.

  3. 3

    Approve the plan

    The agent reads your code, shows you a plan with the files it will touch, and waits. Change anything you disagree with.

  4. 4

    Check the result

    When the changes are live, run the free checks below on your site to confirm each fix.

What the agent does

Images are usually the heaviest part of the production site and the part search engines and screen readers understand least. Fix them at the source: the image component, the upload pipeline and the templates, so every image is described, sized and served efficiently.

  1. 1. Inventory

    List where images come from (static files, a CMS, user uploads, a CDN) and how they are rendered (a framework image component, plain <img>, CSS backgrounds). Report images with no alt, oversized files, missing width and height, and lazy loading on above-the-fold images.

  2. 2. Alt text

    Meaningful images get alt text that says what they show in context; decorative images get alt="". For dynamic images, build alt text from data (a product's name and what the screenshot shows). Add an alt field to upload forms where users add images.

  3. 3. Formats and sizes

    Serve WebP or AVIF with fallbacks through the framework's image component or the CDN, responsive srcset and sizes, and source files resized to the largest size actually shown. Set width and height (or aspect ratio) on every image to prevent layout shift.

  4. 4. Loading

    Lazy-load images below the fold; never lazy-load the main above-the-fold image, and give it fetchpriority="high". Use descriptive file names for new images. Add important images to the sitemap if the site depends on image search.

Done means

  • Every meaningful image has alt text and decorative ones have empty alt.
  • Images are served in modern formats at the sizes shown, with srcset where useful.
  • Every image has width and height or an aspect ratio.
  • Below-the-fold images lazy-load and the hero image does not.

Questions

What makes good alt text?

A short description of what the image shows and why it is there, as you would say it to someone who cannot see it. Not a list of keywords.

Should every image be lazy loaded?

No. The main image at the top of the page should load immediately; lazy loading it delays the Largest Contentful Paint.

WebP or AVIF?

Both are much smaller than JPEG and PNG. AVIF is usually smaller still; serve it where supported with WebP or JPEG as a fallback, which most image components do for you.

Does this prompt add links to Aback Launch to my site?

No. Nothing in the prompt mentions Aback Launch or asks your agent to link to us. The only exception is an optional badge step, which stays off unless you tick it. Some prompt libraries slip their own link into your codebase by default; we think that should always be your choice.

Which coding agents does it work with?

Claude Code, Cursor, Codex, GitHub Copilot, Windsurf, Cline, and any agent that can read your project and edit files. You can copy it as a plain prompt, save it as a Claude Code skill or a Cursor rule, or add it to AGENTS.md.

Is it safe to run on my real codebase?

The prompt makes the agent read first, show a plan and wait for your approval, and it forbids touching secrets, deploying and deleting data. Still review the changes and run your tests before you deploy, as with any change.

Changelog

  • v1.0First version.

Launch your startup on Aback Launch

Get a launch page that search engines and AI assistants can read, a place in the weekly launch list, and a review by a real person. Free to join.