Skip to content

Hooks & Filters

Divi exposes four families of hooks, split across PHP and JavaScript layers.

The four families

FamilyLayerWhere they firePage
Builder PHP hooksPHPAround the Divi Builder lifecycle: registering modules, loading assets, rendering shortcode output.Divi Builder PHP Hooks
Builder JavaScript hooksJS (via wp.hooks)Inside the visual builder runtime: filter CSS selectors before they're applied, modify rendered output.Divi Builder JavaScript Hooks
Template hooksPHPBefore/after Divi's frontend templates render. Hook into headers, footers, post meta, page output.Divi Template Hooks
Module hooksPHPAround individual module rendering. Filter module attributes, output, and the rendered shortcode.Divi Module Hooks

Mental model

flowchart TB
  subgraph PHP
    A[Builder PHP Hooks] --> M[Module rendering]
    T[Template Hooks] --> M
    H[Module Hooks] --> M
  end
  subgraph JS
    J[Builder JS Hooks via wp.hooks]
  end
  M --> Frontend
  J --> VisualBuilder
  • PHP hooks run on the server, mostly during shortcode rendering or admin page loads.
  • JavaScript hooks run in the browser, scoped to the visual builder, using the standard WordPress wp.hooks API.

Hook signature pattern

Every hook page on this site follows the same structure:

  • Hook name — exact string you pass to add_filter / add_action / wp.hooks.addFilter.
  • Type — Action or Filter.
  • Since — Divi version the hook was introduced in.
  • Parameters — table of param | type | description.
  • Example — minimal working snippet you can adapt.

Adding new hooks

If you're building a module and want to expose your own filters for third parties, use the standard WordPress hook API — apply_filters() in PHP and wp.hooks.applyFilters() in JavaScript. There's no Divi-specific wrapper.

Reference compiled from publicly available Divi developer documentation.