LLM Image Alt Tag Suggester
Uses AI to scan WordPress posts and pages for images missing alt or title tags, and suggests descriptive content for them.
by Gemini · github.com/sphillips1337/wp-llm-image-alt-tag-suggester
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/sphillips1337/wp-llm-image-alt-tag-suggester/archive/refs/heads/main.zipUses AI to scan WordPress posts and pages for images missing alt or title tags, and suggests descriptive content for them.
Warning
IT IS RECOMMENDED TO USE THIS PLUGIN WITH A LOCAL LLM, ESPECIALLY IN BULK MODE AS IT WILL CHEW THROUGH YOUR TOKENS AT A FEARSOME PACE. (It does show a popup warning when you launch bulk mode to this effect in the plugin also)
SECONDLY, THIS IS AN ALPHA VERSION EXPECT BUGS, USE AT YOUR OWN RISK IN A PRODUCTION ENVIRONMENT!!!
Description
This plugin helps improve your website's SEO and accessibility by automatically identifying images in your WordPress posts and pages that are missing 'alt' or 'title' attributes. It then leverages advanced Large Language Models (LLMs), including vision-capable models like Google Gemini, OpenAI GPT-4V, OpenRouter models, or local Ollama (e.g., LLaVA), to analyze the image content and its surrounding text context.
The plugin provides intelligent suggestions for descriptive alt text and concise title tags. You can review these suggestions in a user-friendly admin interface, apply them individually, or bulk process multiple images.
Features:
- Scans all published posts and pages for images without alt/title tags.
- Automatically filters out broken or inaccessible images during scan.
- Stores identified images in a custom database table for easy management.
- Integrates with OpenAI, Google Gemini, OpenRouter, and local Ollama models.
- Includes test mode for debugging without external LLM services.
- Optional vision model support to analyze image content directly.
- Admin interface to list images, view suggestions, and apply changes.
- Single-click suggestion and application for individual images.
- Bulk processing options for suggesting and applying changes to multiple images (processes in small batches with delays).
- Safe content modification that preserves all post formatting and content.
- Automatic fallback to placeholder text when LLM services are unavailable.
- Robust error handling with detailed logging for troubleshooting.
Recent Updates (v1.0.1)
- Fixed critical bug that could erase post content when applying alt tags.
- Added automatic filtering of broken/404 images during scanning.
- Improved error handling and LLM response parsing with multiple JSON extraction methods.
- Added test mode for safe debugging and testing.
- Enhanced content modification system for better reliability.
- Fixed bulk processing AJAX issues and improved sequential processing.
- Added automatic fallback when Ollama server crashes due to resource limitations.
- Implemented proper delays between requests to prevent server overload.
- Added cleanup and ignore functionality for better image management.
Installation
- Create a folder named
llm-image-alt-tag-suggesterin your/wp-content/plugins/directory. - Place the
llm-image-alt-tag-suggester.phpfile into this folder. - Activate the "LLM Image Alt Tag Suggester" plugin through the 'Plugins' menu in WordPress.
- Go to Tools -> LLM Image Alt Tag Suggester.
- Configure your preferred LLM provider (Test Mode, Ollama, OpenAI, OpenRouter, Gemini) and API keys in the plugin settings.
- For testing, select "Test Mode" to verify functionality without external services.
- If you are using Ollama, you can also specify a vision model to use for image analysis.
- Set the public URL of your blog.
- Optionally enable vision support for models that offer it.
- Click "Scan for Images Now" to populate the list of images needing attention.
- Start generating and applying alt/title tag suggestions!