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.
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
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);
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>
Constant
Description
AATS_VERSION
Plugin version
AATS_PLUGIN_DIR
Plugin directory path
AATS_PLUGIN_URL
Plugin URL
AATS_PLUGIN_BASENAME
Plugin basename
Class
Description
AutoAltTitleSync
Main plugin class
AATS_Upload_Handler
Upload and alt generation
AATS_Sync_Handler
Bi-directional sync logic
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.
Developed by Anees Ahmad
This plugin is licensed under the GPLv2 or later.
For support, please visit the WordPress support forums or contact the developer.
If you find this plugin useful, please consider making a donation to support development.