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


Supported attributes include

  • id
  • class
  • name
  • target
  • rel
  • accesskey

Installation and configuration overview

  • Enable the module like normal
  • 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


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.


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


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

Project information