Governed ability

Update WPBakery page code

aafm/wpbakery-update-page-codeGuarded write

Update WPBakery page code is a governed WPBakery Page Builder ability in Agent Abilities for MCP, a free WordPress plugin that runs an MCP server on your site.

Sets the custom CSS, header JS and footer JS of one WPBakery page, the fields of the page settings in WPBakery's editor; give at least one of custom_css, custom_js_header and custom_js_footer. Each field given replaces the page's existing code for that field, and an empty string removes it; previous returns the old value of every field that changed, which is the way back. CSS that holds markup is refused, as WordPress refuses it in custom CSS, and so is a "<" followed by another character, such as a <= range query, where WPBakery cuts the CSS off when it prints it; any other CSS is stored exactly as sent. JS containing a closing script tag is refused, and the JS fields are refused when WPBakery's own Role Manager would not save custom JS for this user. A field equal to what is stored is left alone and not listed in changed. No revision is kept, and the change is not undoable from this plugin's change history. Requires edit access to the post and a user who may post unfiltered HTML. Only while WPBakery Page Builder is active.

How it is governed

The same model as every ability in the plugin, stated for this one.

  • Off until you enable it

    Like every ability, Update WPBakery page code ships switched off. You turn it on one at a time, and an update never switches on a tool it serves.

  • Guarded write

    Writes stay conservative, and the plugin re-checks the capability before the call runs.

  • Capability gated

    A connection only sees Update WPBakery page code if the user you connected can run it, and the plugin checks that capability again before it executes.

  • Every call audited

    The call is written to the log in your own database, denials included, with the argument keys and the identifiers it touched, never free-text content.

Update WPBakery page code is one of the 12 governed WPBakery Page Builder abilities. See the full WPBakery Page Builder MCP integration.

See it in action

An illustrative run. Your real calls and data stay on your own site.

agent-abilities · auditGoverned
YouUpdate WPBakery page code on this site.
RunRunning aafm/wpbakery-update-page-code
GateAllowedcapability re-checked before running
Auditaafm/wpbakery-update-page-code · principal: editor · args: post_id
ResultApplies the change, then writes the call to the audit log.

Try it with a prompt

Example requests you could paste to your agent.

  1. Set the custom CSS of page 57 to hide the second separator.
  2. Clear the footer JS on page 57.

These are illustrative example prompts. The agent runs them as the user you connected, checked against that user's capabilities and written to your audit log.

Frequently asked

Short answers for Update WPBakery page code.

How do I get the old code back?

previous returns the old value of every field that changed, and sending it back restores it. No revision is kept.

What does it need?

Edit access to the post and a user who may post unfiltered HTML. The page header and footer JS fields are also refused when WPBakery's Role Manager would not save custom JS for that user.

Back to all abilities

Governed by default, from the first call.

Update WPBakery page code is off until you enable it, scoped to the user you connect, and logged like everything else. Turn on only what you need.

Every ability off until you enable it, capability-gated on every call.