Block Data Attribute

plugin banner

This plugin designed with extensibility in mind for data that should be associated with a particular block type but need not have any defined meaning.

Author:Mahdi Yazdani (profile at wordpress.org)
WordPress version required:6.0
WordPress version tested:7.0.9
Plugin version:2.1.0
Added to WordPress repository:10-02-2020
Last updated:10-06-2026
Rating, %:100
Rated by:4
Plugin URI:
Total downloads:7 449
Active installs:300+
plugin download
Click to start download

Block Data Attribute lets you attach custom data-* attributes to core WordPress blocks straight from the block settings sidebar. No theme edits, no custom code, no block validation errors.

data-* attributes are a standard HTML mechanism for storing extra information on elements. They are widely used for JavaScript interactions, CSS targeting, analytics tagging, accessibility enhancements, and third-party integrations. This plugin brings that capability into the block editor in a clean, structured way.

Key Features

  • Add any number of data-* attributes to supported blocks.
  • Name and value fields with input sanitisation built in.
  • Drag-and-drop reordering of attributes within the sidebar panel.
  • Attributes are saved directly in block markup — no post meta, no database overhead.
  • Fully extensible: register additional allowed block types via a JavaScript filter.
  • No build step required — ships as a single plain JavaScript file.
  • Translation-ready.

Supported Blocks

Out of the box the following core blocks support custom data attributes:

  • core/button
  • core/column
  • core/columns
  • core/group
  • core/heading
  • core/paragraph

Screenshots
FAQ
ChangeLog