JPKCom Gutenberg Image Block Alt-Attribute — Guide & Tips
Dynamically and SEO-friendly update the alt text of Gutenberg image blocks in WordPress — installation and practical notes for the JPKCom plugin.
JPKCom Gutenberg Image Block Alt-Attribute provides SEO-friendly, dynamic updates for the alt text of Gutenberg image blocks. The plugin works without a settings page — once activated, it takes effect automatically.
Guide
Requirements
- WordPress 6.9 or newer (tested up to WordPress 7.1)
- PHP 8.3 or newer
Installation
- In your admin panel, go to Plugins → Add New and click Upload Plugin.
- Choose the plugin's ZIP file and click Install Now.
- Click Activate — the plugin is ready to use right away.
There is no settings page. Once the plugin is active, the alt attributes of image blocks are updated dynamically.
Tips & Tricks
- Meaningful alt text helps SEO: Good alt attributes benefit both search engines and screen readers. The plugin keeps the alt text in the
core/imageblock dynamically up to date. - Activate and forget: As there is no configuration, nothing needs to be set up after activation.
$characters in alt text — updating to 1.0.8 recommended: If an alt text contained the sequences$1,${1},$2or\1, it corrupted the rendered<img>tag up to version 1.0.7. Those sequences are backreferences inside the replacement, so ordinary editorial text — a price, a version number — was substituted with part of the image tag. In the$2case the tag was closed early and the remainder leaked onto the page as visible text. Found and fixed by @yoldaolmak (Kemal Kaya).- Whitespace-only alt text: Since 1.0.8 an alt text consisting only of whitespace no longer overwrites the alt attribute already present in the markup.
- Reproducible updates: Since version 1.0.2 the plugin uses secure self-hosted updates via GitHub with SHA256 checksums and runs with
declare(strict_types=1).
Further reading
- Source code on GitHub: https://github.com/JPKCom/jpkcom-gutenberg-img-alt
- API documentation (PHPDoc): https://jpkcom.github.io/jpkcom-gutenberg-img-alt/docs/
- This project's changelog