ALT Fix (Bulk) – SQL Robust
Bulk tool to automatically generate and fill missing image ALT attributes in WordPress using a robust SQL approach. It detects images with missing, NULL, empty or whitespace-only ALT text (or missing meta) and generates ALT values based on the attachment title, with optional fallback to the file name. The process runs safely in batches and can be triggered directly from the WordPress admin dashboard.
Install
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/fachu-dev/alt-fix-bulk/archive/refs/heads/main.zipA powerful WordPress plugin that automatically detects and fixes missing image ALT attributes across your entire media library using a robust SQL approach. Perfect for improving SEO and web accessibility compliance.
Features
- Robust SQL detection of images with missing, NULL, empty, or whitespace-only ALT text
- Flexible ALT generation modes:
- Attachment title only
- Attachment title with fallback to filename (recommended)
- Filename only
- Advanced text normalization:
- Replace dashes and underscores with spaces
- Collapse multiple spaces into single spaces
- Optional Title Case formatting
- Configurable batch processing (50-1000 images per batch)
- Real-time progress tracking with visual progress bar and statistics
- Safe execution with transient locks preventing concurrent processing
- Comprehensive logging with timestamped activity records
- Clean admin interface with modern card-based design
- Memory efficient batch processing for large media libraries
Installation
Method 1: Upload via WordPress Admin (Recommended)
- Download the latest release ZIP file from this repository
- In your WordPress admin, go to Plugins > Add New
- Click Upload Plugin
- Choose the downloaded ZIP file and click Install Now
- Click Activate Plugin
Method 2: Manual FTP Upload
- Download and extract the plugin files
- Upload the
alt-fix-bulkfolder to your/wp-content/plugins/directory - Activate the plugin through the Plugins menu in WordPress
Method 3: Git Clone (Development)
cd /path/to/wp-content/plugins/
git clone https://github.com/fachu-dev/alt-fix-bulk.git
Then activate through the WordPress admin.
Usage
- After activation, go to Tools > ALT Fix (Bulk) in your WordPress admin
- Review statistics: See how many images need ALT text
- Configure settings:
- Choose ALT generation mode (title, title+filename fallback, or filename only)
- Set batch size (300-500 for normal hosting, 800-1000 for powerful servers)
- Enable text normalization options as needed
- Run processing:
- Click "Procesar 1 lote" to process one batch and review results
- Click "Procesar hasta terminar" to automatically process all batches
- Use "Pausar" to stop processing at any time
- Monitor progress: Watch the real-time progress bar and review the activity log
Configuration Options
ALT Generation Modes
- Título del adjunto (solo): Uses only the attachment title
- Título → fallback a nombre de archivo: Uses attachment title, falls back to filename if title is empty (recommended)
- Nombre de archivo (solo): Uses only the filename
Text Normalization
- Normalize dashes: Replace
-and_with spaces - Collapse spaces: Convert multiple consecutive spaces to single spaces
- Title Case: Apply Title Case formatting (optional)
Batch Size
- 50-300: Conservative for shared hosting
- 300-500: Recommended for most hosting environments
- 500-1000: For powerful servers or VPS/dedicated hosting
Technical Details
SQL Approach
The plugin uses direct SQL queries to efficiently identify images with missing ALT attributes:
SELECT p.ID
FROM wp_posts p
LEFT JOIN wp_postmeta pm ON pm.post_id = p.ID AND pm.meta_key = '_wp_attachment_image_alt'
WHERE p.post_type = 'attachment'
AND p.post_status = 'inherit'
AND p.post_mime_type LIKE 'image/%'
AND (pm.post_id IS NULL OR pm.meta_value IS NULL OR TRIM(pm.meta_value) = '')
Safety Features
- Transient locks: Prevents multiple instances from running simultaneously
- Batch processing: Avoids memory exhaustion on large libraries
- Non-destructive: Only affects images with missing/empty ALT text
- Progress preservation: Safe to stop and resume processing
Performance
- Processes 300-1000 images per batch depending on server capacity
- Direct SQL operations for maximum efficiency
- Minimal memory footprint with batch-based processing
- Real-time statistics and progress tracking
Use Cases
SEO Optimization
- Improve search engine rankings with proper image ALT attributes
- Ensure all images contribute to SEO value
- Standardize ALT text formatting across the site
Accessibility Compliance
- Meet WCAG accessibility guidelines
- Prepare for accessibility audits
- Improve screen reader compatibility
Site Maintenance
- Clean up after content migrations
- Fix bulk imports with missing ALT text
- Standardize media library metadata
Requirements
- WordPress: 5.0 or higher
- PHP: 7.4 or higher
- Memory: Standard WordPress memory limits (batch processing prevents issues)
- Permissions:
manage_optionscapability required
Support
For issues, feature requests, or contributions:
- GitHub Issues: Report bugs or request features
- Documentation: This README and inline plugin documentation
- Author: fachu.dev
License
This project is licensed under the GPL v2 or later - see the LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
Changelog
1.0.0
- Initial release
- Robust SQL-based ALT attribute detection
- Configurable batch processing system
- Three ALT generation modes
- Advanced text normalization options
- Real-time progress tracking
- Comprehensive logging system
- Modern admin interface
- Safety features and transient locks