Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Release: Change Requests 2.1.9 Minor update available for module change_requests (2.1.9). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Entity Attributes

9 sites Security covered Drupal 11 · not 10 Entity ecosystem
View on drupal.org

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.

Depends on

Dependencies of the latest stable release

  • field Drupal core
  • system Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Jul 2025
Latest release
1 month ago
Releases (12 mo)
2
Maintenance
Active

Release Timeline

Releases

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