AltGen is a Firefox browser extension that helps improve accessibility and SEO on WordPress sites by generating high-quality alt text for images using AI. The extension analyzes both the image and its surrounding HTML context to create meaningful descriptions that accurately reflect the image's purpose.
- Right-click menu on images to trigger alt text generation
- Analysis of image content and surrounding HTML context
- AI-powered alt text generation via OpenAI API
- Human-in-the-loop review and editing of suggested alt text
- Optional direct updating via WordPress REST API
- Integration with AltSync WordPress plugin for site-wide alt text sync/update
- User navigates to a WordPress page/post with images
- User right-clicks on an image needing better alt text
- Extension menu option "Generate Alt Text with AI" appears
- User clicks the option, triggering context extraction
- Extension sends image + context to AI API
- Generated alt text appears in popup for review
- User can copy text to clipboard or approve direct update to WordPress
- Firefox (primary target)
- Chrome/Edge (potential future support)
"permissions": [
"activeTab",
"scripting",
"storage",
"contextMenus",
"downloads",
"<all_urls>"
]
- Manifest (
manifest.json
): Extension configuration - Background Script: Handles context menu creation and API communication
- Content Script: Extracts image and surrounding HTML context
- Popup UI: Displays generated alt text with editing/approval options
- Options Page: Stores API keys and WordPress credentials
- OpenAI API: For generating alt text (GPT-4 or newer with vision capabilities)
- WordPress REST API: For updating image metadata (optional)
- Firefox extension with context menu on images
- Content script to extract image and HTML context
- Intuitive popup UI to display controls and results
- OpenAI API integration (BYOK, GPT-4o with vision capabilities)
- Optimized prompt engineering for high-quality alt text generation
- WordPress REST API authentication using application password
- Direct updating of alt text in WordPress Media Library
- Integration with AltSync WordPress plugin for site-wide alt text updates
- Clone repository
- Load unpacked extension in Firefox Developer Edition and enable AltGen
- Right-click extension icon → Manage extension → three dots → options
- Configure OpenAI API key with access to GPT-4o model
- API Setup: Enter your OpenAI API key in the extension options
- WordPress Integration (Optional but Recommended):
- Set up WordPress username (user's username, not application password name)
- Configure application password to enable updating alt text in Media Library
- AltSync Plugin (Optional but Recommended):
- Install AltSync plugin to sync alt text from Media Library to posts
- Requires OpenAI API key (user-provided)
- Context extraction may vary based on WordPress theme structure
- WordPress API integration requires site credentials (app password)
- Does not work with basic auth enabled
- Mostly vibecoded and kinda slow
The extension works primarily with WordPress sites, especially for updating alt text. On sites where nobody cared for this so far. However, you can still use it to generate alt text suggestions on any site.
Your API key is stored locally in your browser's extension storage.
Currently, the extension is optimized for OpenAI's GPT-4o, but we're exploring support for additional models in future updates. Feel free to fork this, even submit a PR.
- Support for additional browsers (Chrome, Edge)
- Batch processing of multiple images
- AI model selection options
- Local model support for privacy