Custom Attributes give you a way to add extra HTML attributes to any Divi element without editing code.
This includes attributes such as data-*
, role
, aria-*
, or even native attributes like loading
or title
. They provide more control over how your elements behave, interact with scripts, and support accessibility.
Notes:
The new attributes option group manages all attributes. All other attribute-related settings have been deprecated and will be automatically migrated to the new system.
If you have previously added a class or ID using the legacy CSS Class & ID option, those attributes will show up as list items in the new attributes option group.
Use Cases
Accessibility Enhancements: Add
aria-label="Search Form"
orrole="navigation"
to improve screen reader clarity.Custom Data Hooks: Insert
data-tracking="cta-button"
or similar attributes so marketing and analytics tools can identify specific modules.Browser and Performance Control: Use attributes like
loading="lazy"
for images orrel="noopener"
for links to improve performance and security.
How to Use It
Open the the settings of any section, row, column, or module by clicking on the Gear icon, or by clicking on the element itself.
Go to the Advanced tab of the settings panel.
Expand the Attributes option group.
Click on the +Add Attribute option.
Choose the Target element.
Type in the Attribute's name.
Type in the Attribute's value.