This plugin is outdated and might not be supported anymore
Empty Alt Image Container Swap

Empty Alt Image Container Swap

Details
View on WordPress

This plugin enhances the accessibility of image blocks in the WordPress block editor by converting the wrapping <figure> tags to <div> tags when the image has an empty alt attribute. Additionally, it hides the caption for images with empty alt text on the frontend.

Key features:
– Converts <figure> tags to <div> tags for images with empty alt text
– Hides captions for images with empty alt text on the frontend (output a warning to the editor)
– Works dynamically without modifying stored content

Images that are purely decorative and lack an alt attribute do not contribute directly to the understanding of the content, and therefore, wrapping them in a <figure> element is not appropriate.
By replacing <figure> tags with <div> tags for images missing alt text, this plugin ensures proper HTML semantics. <div> elements are generic containers without implicit meaning, making them suitable for presenting images without associated descriptions.

Details

Plugin code:
empty-alt-image-container-swap
Plugin version:
1.1.0
Author:
Outdated:
Yes
WP version:
5.0 or higher
PHP version:
or higher
Test up to WP version:
6.6.2
Total installations:
0
Last updated:
2024-07-29
Rating:
Times rated:
0
accessibility
alt-text
div
figure
images