Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Varbase FAQs 9.2.1 Minor update available for module varbase_faqs (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module provides a user interface for adding and managing HTML attributes like IDs and classes to various Drupal entities, such as nodes, blocks, and taxonomy terms. It allows for consistent attribute management across different content types without needing multiple specialized modules.

Entity Attributes module provides a UI for managing HTML attributes (id, class, data-*, etc.) across various entity types.

Features

Supported Entity Types

  • Nodes
  • Taxonomy Terms
  • Blocks
  • Menus
  • Content Menu Links
  • Static Menu Links
  • Paragraphs
  • ECK entities

Easy to add support for additional entity types.

Supported Attributes

Attributes are edited in YAML format. The module doesn't apply any restrictions on attribute names and values. Any valid attribute name and value entered in the attributes field will be converted to an attributes object and passed to the entity template.

Attribute Sets

Each entity type may support multiple attribute sets used in their templates:

  • attributes: Main container attributes (id, class, data-*)
  • title_attributes: Title-specific attributes
  • content_attributes: Content wrapper attributes
  • Plugin-specific attribute sets

Please check the module's README for more details about module features and usage.

The long story

Do you remember how often you need to highlight one link in a menu or add an anchor to a specific block on the page? Or when you need to add a class to an element on the site to apply some behavior?
Well, if you do, you are not alone.

Sometimes Drupal theming is difficult — you have to create special templates for elements that should stand out. Sometimes you need more semantic markup, sometimes you just need to add an ID to an element. These cases, and many others, are easily covered by HTML attributes. Despite Drupal having great support for attributes at the template level, there is a lack of UI for managing them at the content level and the glue to connect them to templates.
This is what this module is for.

What? Yet another module for managing classes? I already have five such modules installed.

Right, there are over a dozen good modules that solve these problems and do it well. But this raises another problem — you need to install multiple modules to solve similar issues for different entity types.

Similar modules are focused on handling classes or attributes for specific entity types, and sometimes that is absolutely okay. But if you need a consistent experience for managing attributes across most entity types, this module is quite unique.

Here is a list of the most popular attribute management modules that can be fully or partially replaced by Entity Attributes:

OK, makes sense, but is this module better?

I am not saying this module is the best one ever. It is fully built on Drupal Core APIs. It uses the right approaches for its functionality (stores data in the right place, manages operations the right way). It utilizes modern Drupal and PHP features. It is simple, flexible, and extensible. It is written based on many years of expertise in Drupal frontend and backend development. It is designed to solve one specific problem, and it solves it in the easiest and most consistent way. But it may just not suit your use case.

Activity

Total releases
4
First release
Jul 2025
Latest release
1 week ago
Releases (12 mo)
4 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.2.0 Stable Jul 6, 2026
1.1.0 Stable Sep 1, 2025
1.0.1 Stable Jul 20, 2025
1.0.0 Stable Jul 20, 2025