Auto Title & Alt Sync
Auto Alt & Title Sync is a powerful WordPress plugin that streamlines your media workflow by automatically populating alt text from image filenames during upload. It also provides real-time bi-directional synchronization between the Title and Alt fields in the Media Library, saving you time and improving accessibility.
Key Features
- Auto Alt Generation: Automatically generates alt text from image filenames on upload
- Smart Formatting: Converts filenames to readable text (removes dashes, underscores, dots, etc.)
- Title Case Conversion: Automatically converts alt text to proper Title Case
- Bi-directional Sync: Changes to Title auto-update Alt, and changes to Alt auto-update Title
- Real-time Updates: See changes instantly as you type in the Media Editor
- Media Modal Support: Works in the media modal when adding images to posts/pages
- Manual Sync: One-click sync button in the media editor
- AJAX Powered: Fast, seamless synchronization without page reloads
- Lightweight: Minimal impact on performance
- Translation Ready: Fully internationalized
How It Works
- Upload an image → Alt text is automatically generated from the filename
- Edit the Title → Alt text updates in real-time
- Edit the Alt text → Title updates in real-time
Example Transformations
Filename Generated Alt Text
beach-sunset.jpg
Beach Sunset
product_123_main.png
Product 123 Main
my--photo---best.jpeg
My Photo Best
screenshot-2024-01-15.png
Screenshot 2024 01 15
Benefits
- Save Time: No more manually typing alt text for every image
- Improve Accessibility: Proper alt text makes your site more accessible
- Boost SEO: Better alt text improves search engine rankings
- Consistency: Uniform formatting across all your images
- User Friendly: Intuitive sync between Title and Alt fields
Compatibility
- Works with all WordPress themes
- Compatible with Classic Editor and Block Editor (Gutenberg)
- Works with major page builders (Elementor, WPBakery, etc.)
- Supports all image formats (JPG, PNG, GIF, WebP, SVG, etc.)
Customization
Filters and Hooks
The plugin provides several filters for developers to customize functionality:
aats_generated_alt_text Filter the generated alt text before saving.
add_filter('aats_generated_alt_text', function($alt_text, $filename) {
// Custom processing
return $alt_text;
}, 10, 2);
aats_title_to_alt Filter the title to alt conversion.
add_filter('aats_title_to_alt', function($alt, $title) {
// Custom conversion
return $alt;
}, 10, 2);
aats_alt_to_title Filter the alt to title conversion.
add_filter('aats_alt_to_title', function($title, $alt) {
// Custom conversion
return $title;
}, 10, 2);
Action Hooks
aats_before_sync Fires before sync operations.
add_action('aats_before_sync', function($attachment_id, $field, $value) {
// Custom logic before sync
}, 10, 3);
aats_after_sync Fires after sync operations.
add_action('aats_after_sync', function($attachment_id, $field, $value, $result) {
// Custom logic after sync
}, 10, 4);<h3>Developer Notes</h3>
Plugin Constants
Constant Description
AATS_VERSION
Plugin version
AATS_PLUGIN_DIR
Plugin directory path
AATS_PLUGIN_URL
Plugin URL
AATS_PLUGIN_BASENAME
Plugin basename
Classes
Class Description
AutoAltTitleSync
Main plugin class
AATS_Upload_Handler
Upload and alt generation
AATS_Sync_Handler
Bi-directional sync logic
JavaScript API
The plugin exposes AATS_Sync globally for developers:
// Check if syncing
AATS_Sync.isSyncing
// Manually trigger sync
AATS_Sync.manualAjaxSync(attachmentId);
// Convert Title to Alt
AATS_Sync.titleToAlt(title);
// Convert Alt to Title
AATS_Sync.altToTitle(alt);<h3>Contributing</h3>
Contributions are welcome! Please submit pull requests or report issues on the plugin’s GitHub repository.
Credits
Developed by Anees Ahmad
License
This plugin is licensed under the GPLv2 or later.
Support
For support, please visit the WordPress support forums or contact the developer.
Donations
If you find this plugin useful, please consider making a donation to support development.
