Attributes for Blocks
Allows to add HTML attributes to Gutenberg blocks.
Not scanned yet
WordPress plugin
4k installs
Install in
This plugin adds additional advanced inspector controls to Gutenberg blocks that allow to add any custom HTML attributes to the block’s front-end output. This allows you to add inline styles to fine-tune the block’s appearance, set aria attributes to improve your site’s accessibility, add data attributes to integrate with any JavaScript modules or even JavaScript DOM event attributes such as onclick, onchange or onload.
Written by Joobi from the project's own listing. See the source page
2 Dec 2026
Version 1.0.16 released. Not scanned yet.
1.0.16
- Tested with WordPress 7.2.
- Update
@wordpress/*packages.
1.0.15
- Tweaked UI for WordPress 7.1.
1.0.14
- Tweaked UI for WordPress 7.0.
1.0.13
- Tested with WordPress 6.9.
1.0.12
- Added a donate link on the plugin page – supporters get a 50% off coupon for my brand new WordPress theme.
- Fix potential duplication when merging style attribute values.
- Update
@wordpress/*packages. - Tested with Gutenberg 21.7.0.
1.0.11
- WP 6.8.
1.0.10
- Added
afb_get_attributesfilter, allowing to dynamically modify attributes.
1.0.9
- Try fix issue with
current_user_cancheck inpre_kseswhenSECURE_AUTH_COOKIEisn’t defined.
1.0.8
- Try fix issue with
current_user_cancheck inpre_kseswhen WP pluggable functions aren’t loaded.
1.0.7
- Security update: users without
unfiltered_htmlcapability can no longer add attributes. When a user without the capability updates a post all existing attributes are stripped. Issue discovered by Francesco Carlucci (CVE ID: CVE-2024-8318, CVSS Severity Score: 6.4 (Medium)). The vulnerability made it possible for authenticated attackers, with Contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accessed an injected page. - Tested up to WordPress 6.6.
- Update
@wordpress/*packages.
1.0.6
- Tested up to WordPress 6.5.
- Fix PHP notice when rendering a block that doesn’t have any attributes.
- Update
@wordpress/*packages.
1.0.5
- Use
WP_HTML_Tag_Processorfor adding HTML attributes. - Remove
afb_sanitize_attribute_keyandafb_sanitize_attribute_valuefilters (now handled byWP_HTML_Tag_Processor). - Use
render_blockfilter to apply attributes instead of overriding block’srender_callback. - Move all PHP code to main file for simplicity.
- Add
$attributeparam toafb_attribute_separatorfilter. - Remove uppercase text transform from attribute input labels, use monospace font for value.
- Add button to edit attributes in a modal for more space.
- Update
@wordpress/*packages. - Regression: for blocks that render multiple root elements attributes are only applied to the first one.
1.0.4
- Add
afb_sanitize_attribute_keyandafb_sanitize_attribute_valuefilters. - Catch errors when using invalid characters in attribute name/value.
- Update
@wordpress/*packages.
1.0.3
- Update
@wordpress/*packages. - Test with WordPress 6.0.
- Convert advanced style attribute editor to TypeScript and refactor.
- Fix duplicate attribute values being output when the block has both JS and PHP render functions.
- Add GitHub link.
- Remove
srcfolder from plugin.
1.0.2
- Add advanced editor for style attribute.
- Remove jQuery.
1.0.1
- Fix special character encoding for dynamic blocks.
25 Aug 2021Listed on Joobi from WordPress.org.
Follow this listing's changes (Atom feed)