Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

link_attributes

56,624 sites Security covered
View on drupal.org

Overview

Link attributes widget provides an additional widget for the link field found in Drupal core.

The widget allows users to set attributes on their link.

In addition the module alters the default menu link content link field to use this widget, allowing menu links to have attributes too

Features

Supported attributes include

  • id
  • class
  • name
  • target
  • rel
  • accesskey
  • aria-label (since 8.x-1.3)
  • title (since 8.x-1.7)
  • Linkit support (since 2.1.0) - via a submodule

Should I use the 1.x or 2.x version?

New installs should use the 2.x version. Existing sites on the 1.x version are encouraged to update to the 2.x stream. There are no breaking changes, but 2.x splits the automatic use of the widget for menu links into a submodule.

Installation and configuration overview

  • Enable the module like normal
  • If using the 1️⃣.x branch, It will immediately take effect on menu link content entities.
  • If using the 2️⃣.x branch, enable the Link Attributes Menu Link Content sub module and It will immediately take effect on menu link content entities.
  • For other link fields, edit the widget using 'Manage form display' and select the 'Link (with attributes)' widget
  • Read the documentation for how to modify defaults and add custom attributes.
  • Optionally enable the Linkit Attributes sub-module to make an additional Linkit (with Attributes) widget available.

Limitations

Note that some menu links are provided by modules. These links do not have a link field, and cannot have attributes added. For example the 'Contact' link provided by the contact module in the footer menu. Only links that are added using menu link content entities have a link field.

For those, just disable the default and add your own using Menu Link Content

Known problems

Please use the issue queue to search for any known issues or to add a new one.

Credits

Link attributes was written by Lee Rowlands (@larowlan).

Tutorials

  • Drupal modules the one percent did a screencast of this module in action (2 minutes long)

Similar modules

Whilst these modules have a similar impact on menu links, they don't support the generic link field like Link Attributes does. Using Link attributes means you can leverage this functionality for link fields on any entity type, not just menu links.

  1. Menu attributes: https://www.drupal.org/project/menu_attributes
  2. Menu Link Attributes: https://www.drupal.org/project/menu_link_attributes
  3. Menu Item Extras: https://www.drupal.org/project/menu_item_extras

Activity

Total releases
1
First release
Nov 2025
Latest release
5 months ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
2.1.2 Stable Nov 13, 2025