Title: Empty Alt Image Container Swap
Author: Akari Doi
Published: <strong>26 juli 2024</strong>
Last modified: 24 mei 2026

---

Plugins zoeken

![](https://ps.w.org/empty-alt-image-container-swap/assets/banner-772x250.jpg?rev
=3127452)

![](https://ps.w.org/empty-alt-image-container-swap/assets/icon-256x256.jpg?rev=
3127452)

# Empty Alt Image Container Swap

 Door [Akari Doi](https://profiles.wordpress.org/akari_doi/)

[Download](https://downloads.wordpress.org/plugin/empty-alt-image-container-swap.1.1.1.zip)

 * [Details](https://nl.wordpress.org/plugins/empty-alt-image-container-swap/#description)
 * [Beoordelingen](https://nl.wordpress.org/plugins/empty-alt-image-container-swap/#reviews)
 *  [Installatie](https://nl.wordpress.org/plugins/empty-alt-image-container-swap/#installation)
 * [Ontwikkeling](https://nl.wordpress.org/plugins/empty-alt-image-container-swap/#developers)

 [Ondersteuning](https://wordpress.org/support/plugin/empty-alt-image-container-swap/)

## Beschrijving

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.

## Installatie

There are two ways to install the “Empty Alt Image Container Swap” plugin:

 1. Upload and Install Manually
 2.  a. Download the plugin ZIP file to your computer.
     b. Log in to your WordPress admin dashboard.
     c. Navigate to Plugins > Add New > Upload Plugin.
     d. Click “Choose File” and select the downloaded ZIP file.
     e. Click “Install Now” to upload and install the plugin.
     f. Once installed, click “Activate Plugin” to activate it.
 3. Install from WordPress.org Directory
 4.  a. Log in to your WordPress admin dashboard.
     b. Navigate to Plugins > Add New.
     c. Search for “Empty Alt Image Container Swap” in the search field.
     d. Find the plugin in the results and click “Install Now”.
     e. Once installed, click “Activate Plugin” to activate it.

After activating the plugin through either method, it will automatically convert`
<figure>` tags to `<div>` tags for image blocks with missing alt text when rendering
pages. No further configuration is required.
 For best accessibility practices, 
it’s recommended to provide descriptive alt text for all images. However, if you
forget or choose not to add alt text for certain images, this plugin ensures proper
markup by using `<div>` containers instead of `<figure>`.

## FAQ

### What happens if I deactivate the plugin?

When you deactivate the plugin, all image blocks will immediately revert to their
original state. The plugin does not make any permanent changes to your content, 
so you don’t need to update or edit anything after deactivation.

### Why are captions hidden for images with empty alt text?

Captions are typically used to provide additional context or information about an
image. For decorative images (those with empty alt text), captions are usually unnecessary
and may even cause confusion, which is why they are hidden.

### Can I still add captions to images with empty alt text in the editor?

Yes, you can still add captions to images with empty alt text in the editor. However,
these captions will not be displayed on the frontend while the plugin is active.

### Does this plugin modify my database or stored content?

No, this plugin does not make any changes to your database or stored content. It
works dynamically when pages are rendered, which means your original content remains
intact.

## Beoordelingen

Er zijn geen beoordelingen voor deze plugin.

## Bijdragers & ontwikkelaars

“Empty Alt Image Container Swap” is open source software. De volgende personen hebben
bijgedragen aan deze plugin.

Bijdragers

 *   [ Akari Doi ](https://profiles.wordpress.org/akari_doi/)

“Empty Alt Image Container Swap” is vertaald in 1 locale. Dank voor [de vertalers](https://translate.wordpress.org/projects/wp-plugins/empty-alt-image-container-swap/contributors)
voor hun bijdragen.

[Vertaal “Empty Alt Image Container Swap” in je eigen taal.](https://translate.wordpress.org/projects/wp-plugins/empty-alt-image-container-swap)

### Interesse in ontwikkeling?

[Bekijk de code](https://plugins.trac.wordpress.org/browser/empty-alt-image-container-swap/),
haal de [SVN repository](https://plugins.svn.wordpress.org/empty-alt-image-container-swap/)
op, of abonneer je op het [ontwikkellog](https://plugins.trac.wordpress.org/log/empty-alt-image-container-swap/)
via [RSS](https://plugins.trac.wordpress.org/log/empty-alt-image-container-swap/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.1.1

 * Fixed JavaScript translations not working by adding wp_set_script_translations()
 * Tested up to WordPress 7.0

#### 1.1.0

 * Added feature to hide captions for images with empty alt text on the frontend
 * Improved code for handling empty alt text cases
 * Updated plugin to work dynamically without modifying stored content

#### 1.0.4

 * Initial release

## Meta

 *  Versie **1.1.1**
 *  Laatst geüpdatet **5 maanden geleden**
 *  Actieve installaties **Minder dan 10**
 *  WordPress versie ** 5.0 of nieuwer **
 *  Getest t/m **7.0.7**
 *  Talen
 * [English (US)](https://wordpress.org/plugins/empty-alt-image-container-swap/)
   en [Japanese](https://ja.wordpress.org/plugins/empty-alt-image-container-swap/).
 *  [Vertaal in je eigen taal](https://translate.wordpress.org/projects/wp-plugins/empty-alt-image-container-swap)
 * Tags
 * [accessibility](https://nl.wordpress.org/plugins/tags/accessibility/)[Alt Text](https://nl.wordpress.org/plugins/tags/alt-text/)
   [div](https://nl.wordpress.org/plugins/tags/div/)[figure](https://nl.wordpress.org/plugins/tags/figure/)
   [images](https://nl.wordpress.org/plugins/tags/images/)
 *  [Geavanceerde weergave](https://nl.wordpress.org/plugins/empty-alt-image-container-swap/advanced/)

## Waarderingen

Er zijn nog geen beoordelingen ingediend.

[Je beoordeling](https://wordpress.org/support/plugin/empty-alt-image-container-swap/reviews/#new-post)

[Bekijk alle beoordelingen](https://wordpress.org/support/plugin/empty-alt-image-container-swap/reviews/)

## Bijdragers

 *   [ Akari Doi ](https://profiles.wordpress.org/akari_doi/)

## Ondersteuning

Iets te melden? Hulp nodig?

 [Het supportforum bekijken](https://wordpress.org/support/plugin/empty-alt-image-container-swap/)