WP Manifestindependent plugin directory
manifest / media / wp-ai-alt-text

WP AI Alt Text Generator

WordPress plugin: bulk-generates WCAG-compliant alt text for Media Library images using Claude AI vision

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/sahibbilal/wp-ai-alt-text/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Accessibility shouldn't be manual.

WP AI Alt Text Generator scans your WordPress Media Library, finds every image missing alt text, and generates accurate, WCAG-compliant descriptions using Claude AI vision — one click per image or all at once.


What It Does

  • Dashboard under Media → AI Alt Text shows all images in a grid with coverage stats
  • Missing / All / Has Alt Text filter tabs
  • ✨ Generate button per image — Claude vision reads the image and writes descriptive alt text
  • Auto-saves immediately after generation — no extra clicks
  • ✨ Generate All Missing — processes every image without alt text sequentially with a live progress bar
  • Editable — review and tweak before or after saving
  • Coverage meter — shows % of images with alt text at a glance

How It Works

  1. Fetches the image from WordPress (via base64 encoding)
  2. Sends it to Claude Haiku's vision model with an accessibility-focused prompt
  3. Claude returns a concise alt text (max 120 characters), no "Image of" or "Photo of" prefix
  4. Saved to _wp_attachment_image_alt — the standard WordPress alt text field used by all themes and Gutenberg

File Structure

wp-ai-alt-text/
├── wp-ai-alt-text.php          # Bootstrap
├── includes/
│   ├── class-generator.php     # Claude vision API + base64 fetch
│   └── class-admin.php         # Media Library dashboard + AJAX handlers
├── assets/
│   ├── admin.css               # Grid UI, cards, progress bar
│   └── admin.js                # Generate, save, bulk loop with progress
└── README.md

Installation

  1. Upload the wp-ai-alt-text folder to /wp-content/plugins/
  2. Activate the plugin
  3. Go to Media → AI Alt Text
  4. Enter your Claude API key (from console.anthropic.com)
  5. Click ✨ Generate on any image, or Generate All Missing to bulk-process

API Cost

  • Model: claude-haiku-4-5 with vision
  • ~$0.002 per image (input image tokens + short text output)
  • 100 images ≈ $0.20

Part of the 30-Day WordPress AI Plugin Series

Day 4 of building one open-source WordPress + AI plugin every day.

Follow along: bilalmahmood.dev


License

GPLv2 or later