Alt Text Find and Fix
Find and fix missing image alt text across all your WordPress content, for measurable SEO gains. This cool little plugin can also auto-synchronise your Media Library Alt Texts with images in your content. It quietly runs in the background (cron) to keep things up-up-date and maintain your SEO metrics.
Licences for this plugin last forever 😀
100% No-Risk, Money Back Guarantee!
Over the next 14 days, if our plugins aren't right for you, we’ll refund 100% of your money. No questions asked!
About Alt Text Find-and-Fix
Find and fix missing Alt Text in WordPress sites, to improve your SEO metrics and search exposure.
- Modify an image’s Alt Text in the Media Library: the plugin will find all content that references the image and update their Alt Texts.
- Watchdog: Continuously scans all old post/age/product content, looking for images that are missing their Alt Text.
- Notifications: The plugin will email the site administrator with small weekly updates, if there are any images that are still missing their Alt Text.
- Frontend image finder: Highlight images in the frontend of your site, even if they’ve not come from your media library.
How Does Alt Text Affect Image SEO?
Setting alt text for photos is crucial for SEO and a major ranking element for search engines, as we’ve already mentioned. Alt tags for images give search engine crawlers rich information about what a picture is showing, enabling them to properly index an image.
- An absolute must-have for content-rich sites!
Using Alt Text Find-and-Fix
The primary goal is to eliminate the need to update image Alt Texts within a site’s content. Instead, all you need to do is maintain your Alt Texts in the Media Library and the plugin will synchronise these to your content.
The plugin tracks which images are embedded in which pages/posts/content. When you update the Alt Text for an image in the Media Library, all instances of the image are updated on your site. This means you can write your content, then go to your Media Library and set all your Alt Texts afterwards.
ImportantMake sure to put the Media Library into List View, to get access to the Alt Text Missing/Present column.
Measuring the SEO Improvement
We recommend using an external SEO monitor to help detect problems (identify possibilities) on your site. Our favourite is Seobility, but any good SEO monitoring tool will do. When you’ve set the Alt Texts in the Media Library, the plugin will do the rest.
Settings
The most significant setting is the option that tells Alt Text Find-and-Fix whether to “only update content images’ Alt Text when they’re missing” or “always override content images’ Alt Text with the Alt Text that’s specified in the Media Library. By default, the plugin won’t override your existing Alt Texts, but the recommended practice is to enable this first option.
Notification emails are sent once-a-week if the system detects any images in your Media Library that are missing their Alt Texts. If all your images are configured, you won’t receive any notification emails. It’s recommended that you enable this option.
The “watchdog” is a periodic “cron job” that runs every 10 minutes, scanning your site’s content for images. If your site is running cheap hosting, the watchdog might slow-down your website for some visitors. If you experience a slow-down after installing the plugin, try reducing the batch-size down to one. Managed WordPress hosting with a properly configured wp-cron will be unaffected by the watchdog, and you can safely increase the batch-processing size to something like 20, 30 or 40 posts at-a-time.
Image Formats
By default, the plugin works with the following media MIME Types:
- image/jpeg
- image/gif
- image/png
- image/bmp
- image/tiff
- image/x-icon
- image/webp
If you want to modify this list, use the altfaf_image_types filter:
/** * Add support for the Windows Bitmap Graphics format. */ function custom_altfaf_image_types($mime_types) { $mime_types[] = 'image/bmp'; return $mime_types; } add_filter('altfaf_image_types', 'custom_altfaf_image_types', 10, 1);
Integrations
Alt Text Find-and-Fix can only fix content if it knows how the content is stored internally (by WordPress). The plugins ships with integrations for the Classic Editor, as well as the built-in Gutenburg Block Editor. We’re working on integrations for the Elementor and Divi page builders, and you can write your own integrations too.
InformationIf you use a Page Builder that’s not supported by Alt Text Find-and-Fix and you’d like us to develop an integration for it – get in touch with us.
Roll-your-own Integration
To implement your own integration for Alt Text Find-and-Fix, you need to implement two filters and one action. For this how-to, we’re going to assume our integration is called “Super Page Builder”.
One: Declare yourself as a Content Provider
Handle the altfaf_get_content_provider filter and return a slug for your integration. The slug is arbitrary – it only has to mean something to your code. Do not use “block-editor” or “classic-editor”.
/** * Declaring our integration's content provider. */ function spb_altfaf_get_content_provider($content_provider, $post) { if (!empty($content_provider)) { // A content provider has already been established, so don't do // anything here. } elseif (empty($content = $post->post_content)) { // The post has no content. } else { $content_provider = 'super-page-builder'; } return $content_provider; } add_filter('altfaf_get_content_provider', 'spb_altfaf_get_content_provider', 10, 2);
Two: Return Image Meta from Content
The “altfaf_get_image_metas_$your_slug” filter should return an array of simple image meta arrays.
/** * Parse some content and return an array of image meta arrays. */ function spb_altfaf_get_image_metas($image_metas, $post) { // Parse $post->post_content using your own code. This is only a // loose example, and shows the structure of the $image_metas array. $super_page_builder_post = spb_get_post($post); // The 'post_alt' property should be attribute-encoded. You should // use esc_attr() to encode it, if $image->get_alt_text() (or // equivalent) returns raw text. foreach ($super_page_builder_post->image_instances as $image_instance) { $image_id = $image_instance->get_id(); $image_metas[$image_id] = array( 'image_id' => $image_id, 'post_alt' => esc_attr($image_instance->get_alt_text()), ); } return $image_metas; } add_filter('altfaf_get_image_metas_super-page-builder', 'spb_altfaf_get_image_metas', 10, 2);
Three: Update Images Within Post Content
When Alt Text Find-and-Fix detects that some content contains images that need updating, it triggers the “altfaf_populate_missing_alts_$your_slug” action. The following is based on the Classic Editor integration that’s built-in to Alt Text Find-and-Fix.
/** * Populate image Alt Texts in a piece of content. */ function spb_altfaf_populate_missing_alts($post) { // Do we copy the Media Library Alt Text every time, or only when the Alt // Text in the post content is empty? $always_fix = \Alt_Text_Find_And_Fix\is_always_use_media_library_alt_enabled(); $change_count = 0; // Loop through the image instances, looking for Alt Texts that need to // be populated. $super_page_builder_post = spb_get_post($post); foreach ($super_page_builder_post->image_instances as $image_instance) { $image_id = $image_instance->get_id(); $new_alt_text = esc_attr(strval(get_post_meta($image_id, '_wp_attachment_image_alt', true))); $old_alt_text = esc_attr($image_instance->get_alt_text()); if (!empty($new_alt_text) && ($new_alt_text != $old_alt_text) && $always_fix) { $image_instance->set_alt_text(''); $old_alt_text = ''; } if (!empty($new_alt_text) && empty($old_alt_text)) { $image_instance->set_alt_text($new_alt_text); ++$change_count; } } // Commit changes. if ($change_count > 0) { $content = $super_page_builder_post->serialize(); $args = array( 'ID' => $post->ID, 'post_content' => $content, ); wp_update_post($args); } } add_action('altfaf_populate_missing_alts_super-page-builder', 'spb_altfaf_populate_missing_alts', 10, 1);
Changelog: Alt Text Find and Fix
Version 1.1.4
Released: 2022-12-06
Small update to improve the element selector used to locate images in the front-end that are missing their Alt text.
Version 1.1.3
Released: 2022-11-18
Expanded the user roles that can see the front-end highlighter for images that are missing Alt Text (the dashed red borders). The new roles are "administrator", "editor", "wpseo_manager" and "wpseo_editor". You can hook this list of roles using the new "altfaf_frontend_roles" filter.
Version 1.1.2
Released: 2022-10-07
Added support for translations, with version one of de_DE (machine-translated).
Older releases
Minor update to exclude the WP Admin Bar from the frontend image finder.
Added a new option so that when set admins are logged-in to the site, images that don't have any ALT Text are highlighted. It's really useful for finding images that have been inserted into your content by plugins, like Avatars.
Initial public release
Minor adjustment to the default settings for new installations.
More tidying-up, in preparation for the initial public release.
- Auto-purge Alt Texts from the media library that are set as empty string.
- Added a weekly email notification for administrators, if one-or-more missing-alt images are found in the media library
Minor fix when updating non-empty alt texts with newer text from the media library.
Removed some diagnostics code
More efficient save-post code... avoid making unnecessary saves in some conditions.
Tidying things up, getting ready for initial public release.
Initial development release
Paul –
This little plugin has quickly become an essential part of my toolkit when building and deploying sites. It makes it so much easier to stay on top of image Alt Texts across all content. Love it!