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

by Bilal Mahmood · github.com/sahibbilal/wp-ai-alt-text · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/sahibbilal/wp-ai-alt-text/archive/refs/heads/main.zip

Readme

WP AI Alt Text Generator

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

Read the full README on GitHub →