Este plugin no se ha probado con las últimas 3 versiones mayores de WordPress. Puede que ya no tenga soporte ni lo mantenga nadie, o puede que tenga problemas de compatibilidad cuando se usa con las versiones más recientes de WordPress.

Block Data Attribute


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. data-* attributes will allow you to store extra information on different Gutenberg blocks, without other hacks such as non-standard attributes, appending properties on DOM, or modifying a block as HTML which will throw a block validation error when opening the post edit page once again.


  • Plugin Settings


Minimum Requirements

  • PHP version 7.2 or greater.
  • MySQL version 5.6 or greater or MariaDB version 10.0 or greater.
  • WordPress version 5.2 or greater.

Automatic installation

Automatic installation is the easiest option — WordPress will handle the file transfer, and you won’t need to leave your web browser. To do an automatic install of the plugin, log in to your WordPress dashboard, navigate to the Plugins menu, and click “Add New.”

In the search field type “Block Data Attribute”, then click “Search Plugins.” Once you’ve found the plugin, you can view details about it such as the point release, rating, and description. Click “Install Now,” and WordPress will take it from there.

Manual installation

The manual installation method requires downloading the plugin and uploading it to your webserver via your favorite FTP application. The WordPress codex contains instructions on how to do this here.


Automatic updates should work smoothly, but we still recommend you back up your site.

Preguntas frecuentes

How do I create a custom data attribute?

  1. Log into your WordPress website and navigate to Dashboard.
  2. Create a new page, by visiting “Pages” » “Add New”.
  3. Click on the “Add Block” button and select the “Button” block. Alternatively, you can start typing /button in a new paragraph block, then press enter.
  4. Once you’ve inserted the block, you can use the block settings sidebar to add your custom data attribute.
  5. Clicking on the cog icon next to the publish button will toggle the visibility of this sidebar.
  6. In the block sidebar, you can expand the Data Attributes section to add custom attributes as needed.
  7. Publish the page.

Which blocks are allowed to accept custom data attributes?

Currently, custom data attributes can be saved within the following blocks:

  • core/paragraph
  • core/heading
  • core/button
  • core/group

How do I get help with the plugin?

The easiest way to receive support is to “Create a new topic” by visiting Community Forums page here.

Make sure to check the “Notify me of follow-up replies via email” checkbox to receive notifications, as soon as a reply posted to your question or inquiry.

Please note that this is an opensource 100% volunteer project, and it’s not unusual to get reply days or even weeks later.

Can I help in translating this plugin into a new language?

The plugin is fully translation-ready and localized using the GNU framework, and translators are welcome to contribute to the plugin.

Here’s the the WordPress translation website →

How do I contribute to this plugin?

We welcome contributions in any form, and you can help reporting, testing, and detailing bugs.

Here’s the GitHub development repository →

Did you like the idea behind this plugin?

Please share your experience by leaving this plugin 5 shining stars if you like it, thanks!

I need help customizing this plugin?

Professional engineer and independent creative technologist in tech · over 6 years experience working from prototype to production · developing WordPress products, services, and eCommerce solutions.

Available for hire →


8 de octubre de 2020
Saved me from having to build it myself. Surprised this still isn't built into native block functionality. Thank you!
15 de agosto de 2020
I have to add a data attribute to one my of blocks and I've found this plugin developed by you. Unfortunately, the plugin doesn't allow me to type slash (/) or backslash (\) in the Value field. I know this is blocked with Javascript but I wasn't able to figure out which line of the code is causing this. Thank you!
Leer todas las 4 reseñas

Colaboradores y desarrolladores

Este software es de código abierto. Las siguientes personas han contribuido a este plugin.


Traduce "Block Data Attribute" a tu idioma.

¿Interesado en el desarrollo?

Revisa el código, echa un vistazo al repositorio SVN o suscríbete al registro de desarrollo por RSS.

Registro de cambios


  • Fixed incorrect escaping in data value attribute pair.


  • Updated node modules.
  • Compatibility with WordPress 5.5


  • Multiple code standards improvements.
  • Compatibility with WordPress 5.4.1


  • Multiple code standards improvements.
  • Compatibility with WordPress 5.4.0


  • Fixed Github repo web-address.
  • Updated plugin banner image.


  • Initial release.