Auto-generate missing ALT text for WordPress image attachments
AutoAltify is a powerful WordPress plugin that automatically generates descriptive ALT text for images in your media library. It supports multiple generation modes, bulk operations, logging, and provides developer-friendly hooks for customization.
- ✨ Automatic ALT Text Generation - Generate ALT text from image titles, filenames, or combined with site name
- 🎯 Three Generation Modes
- Title Only - Use clean image title as ALT text
- Title + Site Name - Combine title with your blog name
- Clean Filename - Extract readable text from filenames, removing noise
- 🚀 Bulk Operations - Generate ALT text for your entire media library with one click
- ⚙️ AJAX Batching - Process images in batches to prevent timeouts
- 📋 Media Library Integration - View ALT status directly in media library columns
- 📊 Logging - Optional detailed logging for troubleshooting
- 🎮 Bulk Actions - Process selected images from media library
- 🔌 Developer Hooks - Extensive filters and actions for custom integration
- 🌍 Multi-language Ready - Fully translatable (text domain:
autoaltify)
- Download the plugin files
- Upload to
/wp-content/plugins/autoaltify/directory - Activate the plugin in WordPress admin
- Go to Settings → AutoAltify to configure
Navigate to Settings → AutoAltify in the WordPress admin panel.
Enable automatic ALT text generation when new images are uploaded to your media library.
Choose how AutoAltify builds ALT text:
- Title Only - Uses just the image title
- Title + Site Name - Appends your blog name to the title
- Clean Filename - Extracts readable text from filenames, removing common noise words (v1, v2, final, copy, etc.)
Select which image formats AutoAltify will process:
- JPG/JPEG
- PNG
- GIF
- WebP
- AVIF
- SVG
Turn on logging to help troubleshoot generation issues. Logs are stored at wp-content/uploads/autoaltify-logs/autoaltify.log.
Set the number of images to process per AJAX batch when running bulk operations (minimum: 5, maximum: 200).
- Go to Media Library
- Select one or more images
- From the "Bulk Actions" dropdown, choose "Generate ALT with AutoAltify"
- Click "Apply"
- Go to Settings → AutoAltify
- Under "Tools", click "Run ALT Generator on all media (missing only)"
- Watch the progress bar as the plugin processes your images
- The tool only generates ALT text for images that don't already have it
A new "ALT Status" column appears in the media library showing:
- Present (green) - Image has ALT text
- Missing (red) - Image needs ALT text
Image Title: "Product Photo"
Generated ALT: "Product Photo"
Image Title: "Sunset Landscape"
Site Name: "Travel Blog"
Generated ALT: "Sunset Landscape – Travel Blog"
Filename: "IMG_2024_01_15_sunset-final-v2.jpg"
Generated ALT: "Sunset" (removes IMG, dates, version numbers, "final")
Allows modification of the generated ALT text before it's saved.
Parameters:
$alt(string) - The generated ALT text$attachment_id(int) - The attachment post ID
Example:
add_filter( 'autoaltify_generated_alt', function( $alt, $attachment_id ) {
// Add prefix to all generated ALT text
return 'Image: ' . $alt;
}, 10, 2 );Modify the cleaned title before final ALT text generation (Title Only mode).
Parameters:
$title(string) - The cleaned title
Example:
add_filter( 'autoaltify_clean_title', function( $title ) {
// Convert to lowercase
return strtolower( $title );
} );Modify the cleaned filename before final ALT text generation (Clean Filename mode).
Parameters:
$name(string) - The cleaned filename
Example:
add_filter( 'autoaltify_clean_filename', function( $name ) {
// Add custom suffix
return $name . ' - Image';
} );The plugin uses a modular architecture with the following main classes:
Handles ALT text generation logic.
Methods:
build_alt( $attachment_id, $title, $mode )- Generate ALT text for an attachment$attachment_id(int) - The attachment ID$title(string) - Image title$mode(string) - Generation mode: 'title_only', 'title_site', or 'filename_clean'- Returns: (string) Generated ALT text
Handles operation logging.
Methods:
log( $message, $enabled )- Log a message if logging is enabled$message(string) - Message to log$enabled(bool) - Whether logging is enabled- Returns: (bool) Success
get_log_dir()- Get the log directory pathget_log_file()- Get the log file pathclear_logs()- Clear all logs
Manages plugin settings.
Methods:
get_all()- Get all optionsget( $key, $default )- Get a specific option$key(string) - Option key$default(mixed) - Default value- Returns: (mixed) Option value
update( $new_options )- Update options$new_options(array) - Options to update- Returns: (array) Sanitized options
Handles admin interface and functionality.
Handles public (frontend) hooks like auto-generation on upload.
- WordPress: 5.0+
- PHP: 7.2+
- MB Functions: Uses
mb_convert_case()for multibyte character support
No. AutoAltify only generates ALT text for images that don't already have it. Existing ALT text is never modified.
Yes! Use the provided filters (autoaltify_generated_alt, autoaltify_clean_title, autoaltify_clean_filename) to customize generation behavior.
Logs are stored in wp-content/uploads/autoaltify-logs/autoaltify.log. You can enable/disable logging in settings, or clear logs manually by deleting the file.
Check these conditions:
- Image must match an allowed MIME type in settings
- Image must not already have ALT text
- Ensure sufficient server permissions for logging directory (if enabled)
Currently, AutoAltify only processes standard WordPress attachments. Use filters to extend functionality for custom implementations.
It removes common noise words (v1, v2, final, copy, img, image, etc.), numeric sequences, and file separators, then capitalizes the result.
No. The AJAX batching system processes a configurable batch of images (default: 30) with 250ms delays, preventing timeouts even on large media libraries.
- Batch processing prevents PHP timeout errors
- Configurable batch sizes (5-200 items)
- Efficient WP_Query with meta query for finding missing ALT text
- Optional logging can be disabled for better performance
- Suitable for media libraries with 1000+ images
- Check if "Auto-generate on upload" is enabled
- Verify image MIME type is in allowed list
- Ensure image doesn't already have ALT text
- Check logs if logging is enabled
- Increase batch size gradually to find optimal setting
- Check server PHP timeout settings
- Verify sufficient server memory (>128MB recommended)
- Check browser console for JavaScript errors
- Ensure
wp-content/uploads/directory is writable - Check server file permissions
- Verify logging is enabled in settings
- Look for existing
autoaltify-logs/directory permissions
The plugin uses a modular architecture with clear separation of concerns:
includes/Core/- Core functionality (Generator, Logger, Options)includes/Admin/- Admin interface and settingsincludes/Public/- Public-facing functionalityassets/- JavaScript and CSS assetslanguages/- Localization files
See DEVELOPER-GUIDE.md for detailed information on extending the plugin.
For issues, questions, or contributions, please refer to the plugin documentation or contact the plugin author.
This plugin is licensed under GPLv2 or later. See the LICENSE file for details.
- Refactored into modular architecture
- Separated core, admin, and public functionality into classes
- Added comprehensive documentation
- Improved code organization and maintainability
- Enhanced logging capabilities
- Added developer hooks and filters
- Initial release
- Auto-generation on upload
- Bulk operations
- Media library integration
- Settings page
Built with WordPress best practices and security in mind.
Made with ❤️ for WordPress developers and site owners.