Attributes for Blocks
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 attri
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 .
Demo
A closer look.
Install via admin dashboard
- 01Go to your WordPress admin dashboard -> Plugins .
- 02Click “Add New”.
- 03Click “Upload Plugin”.
- 04Select the attributes-for-blocks.zip file.
- 05Click “Install Now”.
- 06Activate the plugin from WordPress admin dashboard -> Plugins .
Manual install via FTP upload
- 07Upload the folder “attributes-for-blocks” from attributes-for-blocks.zip file to your WordPress installations ../wp-content/plugins folder.
- 08Activate the plugin from WordPress admin dashboard -> Plugins .
Frequently asked questions.
How do I add an attribute?
In your selected block’s inspector controls (Block settings) scroll all the way to the bottom and click on “Advanced”. It should contain a section called “Additional attributes”. Type an attribute name into the “Add attribute” field and press “Add” to add an attribute for the block. A new input with the attribute’s name should appear below, into which you can optionally insert the attribute value. Example attributes: style , title , target , class , id , onclick , data-* , aria-* .