Get the plugin
WP MCP/Integrations/Page builders

Page builders integration

Divi (4 and 5) AI agent tool reference

Divi comes in two storage formats and WP MCP handles both. Divi 4, the classic builder, stores a layout as shortcodes in post_content with the _et_pb_use_builder flag on; a Divi 4 write replaces the whole layout. Divi 5 stores the layout as block markup in post_content, every block in the divi namespace wrapped in one divi/placeholder block, with _et_pb_use_divi_5 on beside it. WP MCP parses the Divi 5 layout into a tree with a dotted path per block (there is no per-block id in the markup) and writes either one element operation (update, add, remove or move by path) or a whole layout, splicing the original string by byte offsets so every byte outside the touched block is kept exactly, with attributes re-serialized through core's own encoder so a value can never break the comment. A Divi 5 page that already holds a layout needs the expected_hash the read returned, so a page edited since is refused rather than silently overwritten. Element operations need a Divi 5 layout: a Divi 4 page is edited whole, or opened in the Divi 5 builder to convert it. With scope set, the read returns the Divi Library and Theme Builder header, body and footer templates (each a post the operations edit by its id) and the Divi 5 module catalog from a loaded Divi 5. Every write is snapshotted, because post_content and the flags are ordinary post data, so any change is one click from undone.

detect-builderget-builder-contentupdate-builder-content

In practice

How Divi (4 and 5) work goes with an agent.

Divi keeps its layout in post_content, but in two incompatible dialects. Divi 4 writes shortcodes. Divi 5 writes block markup under one divi/placeholder wrapper and sets _et_pb_use_divi_5 beside the _et_pb_use_builder flag. WP MCP recognizes either by flag or, for imported content, by the markup itself, and then treats them differently: a Divi 5 page gets a path-addressed tree and a hash lock, while a Divi 4 page stays a whole-layout replace. Library and Theme Builder layouts are ordinary posts too, so they can be read through the same tool.

Change the CTA button text on the Divi 5 pricing page to Start free trial.

Runs get-builder-content for the tree, dotted paths and hash, then update-builder-content with operation update, the block's path, a text value and expected_hash. The post and both Divi flags are snapshotted first, and the response carries the new hash for chaining the next edit.

Which Theme Builder template applies to the blog, and what is in its header layout?

Runs get-builder-content with scope templates, which returns the Divi Library layouts, the header, body and footer layouts and the Theme Builder templates with their use-on and exclude-from conditions. Divi 5 layouts come back parsed as trees. It is read-only.

What attributes does the Divi 5 button module accept?

Runs get-builder-content with scope catalog, then again with element set to the module name. The summary comes from the loaded Divi 5's module registration: the attributes, their setting groups and the module's defaults. This read needs Divi 5 loaded.

Fix the typo in the old Divi 4 landing page.

Runs get-builder-content, which returns the stored shortcode string, then update-builder-content with the full corrected string. The post and flag are snapshotted first. Asking for an element operation on a Divi 4 page is refused with divi4_operations_unsupported, and there is no hash check on this path.

What your AI can do

Real Divi (4 and 5) operations, every write reversible.

  • Detect Divi 4 and Divi 5 pages
  • Read a Divi 5 page's block tree with a path per block
  • Update, add, remove or move one Divi 5 block by path, or replace the whole layout
  • Replace a Divi 4 shortcode layout whole
  • Read the Divi Library, Theme Builder templates and the Divi 5 module catalog
  • Pin a Divi 5 write to the read's hash so a page changed meanwhile is refused
  • Roll back any layout write exactly

Example prompts

Example Divi prompts.

Which pages are built with Divi, and which use Divi 5?

Change the hero heading on the Divi 5 homepage.

Move the testimonials section above the pricing section on the Divi 5 services page.

Under the hood

The Divi calls, under the hood.

wpmcp, divi

get-builder-content({ post_id: 21 }), Divi 5: block tree with dotted paths and a hash

update-builder-content({ post_id: 21, builder: "divi", operation: "update", path: "0.1.0", attrs: {…}, expected_hash }), snapshotted, restorable

Safety and access

What can be undone on Divi, and what costs what.

Recoverable on Divi

  • The layout lives in post_content and the two Divi flags are post meta, so one post snapshot covers all three and rollback-operation restores them exactly.
  • A Divi 5 write returns a fresh hash, and a rollback is itself a normal operation, so a bad edit can be undone and the page re-read from a clean state.

Divi limits and opt-ins

  • Divi 5 element writes need Divi 5 loaded with its builder enabled, and refuse a missing or stale expected_hash once the page has a layout.
  • Divi 4 pages take a whole-layout replace only, with no element operations and no hash.
  • The design_system scope is not read for Divi: only templates and catalog are.
  • A user without the unfiltered_html capability gets wp_kses_post applied to written strings, as for any post content.

Free or Pro: Detecting Divi pages, reading layouts, templates and the module catalog, and every write are Pro. Nothing here needs an opt-in filter. On the free tier, export-content with mirror:true writes Divi pages to stable line-by-line JSON files for git, and duplicate-post copies a page's meta, Divi flags included, so you can stage an edit on a copy.

Part of WP MCP Pro

The Divi integration is part of WP MCP Pro.

One Pro licence unlocks the Divi tools and every other Pro integration on this site: Elementor deep editing, the other page builders, the forms adapter pack and more, 133 Pro tools in all. The free plugin still covers the rest of WordPress and the full snapshot and undo engine, so you can try the safety model before you buy.

Frequently asked

Divi MCP: questions, answered.

What is the difference between Divi 4 and Divi 5 here?

Divi 4 pages store shortcodes and are edited as a whole layout. Divi 5 pages store block markup, so WP MCP reads them as a tree and edits one block at a time by path, keeping every untouched byte exactly and requiring the read's hash so a page changed meanwhile is never overwritten.

Does Divi have to be active?

Divi 4 reads and whole-layout writes work on the stored shortcodes directly. Divi 5 element editing and the template and catalog scope reads use the loaded Divi 5. Every write is snapshotted first, so any change is one click from undone.

Why does a Divi 5 write need a hash?

Divi 5 markup has no block ids, so a block is addressed by a dotted child path. If the layout changed after the agent read it, the same path could land on a different block. Pinning the write to the read's hash makes a stale write fail instead.

Can it read Divi's Theme Builder?

Yes. get-builder-content with scope templates lists the header, body and footer layouts and each Theme Builder template with its conditions, plus the Divi Library, so an agent can see what applies where before it touches a page.

How does an agent learn which settings a Divi 5 module has?

From the catalog scope. With Divi 5 loaded it returns each module's attributes, the setting groups under them and default attributes, so the agent builds attrs from the real schema instead of guessing key names.

What happens to unsafe markup in a write?

If the user lacks the unfiltered_html capability, written strings pass through wp_kses_post before storing, the same filtering core applies to post content. Users who have that capability write exactly what was sent.

Is there an AI agent for Divi?

Yes, through WP MCP rather than Divi itself. An agent you choose, such as Claude or Cursor, can detect Divi 4 and Divi 5 pages. WP MCP is a separate plugin, not a built-in AI feature of Divi. On the undo side: The layout lives in post_content and the two Divi flags are post meta, so one post snapshot covers all three and rollback-operation restores them exactly.

Point your AI at Divi (4 and 5).