Options & Settingswordpress_update_option

wordpress_update_option

Update a WordPress option value.

wordpress_update_option

Update an option value.

Parameters

5 parameters, 2 required.

NameTypeRequiredWhat it is
optionstringyesOption name
valueanyyesOption value, in the type get_option returns for this option. Text stays text (JSON-encode it if needed). Objects or arrays only for options that already hold them, such as theme_mods.
pathstring or listnoChange one key inside an option that holds many settings, without sending the rest. A dot path such as custom_footer_credits, or a list of keys. With path, value is the new value for that key only. Up to 6 levels. Plugin 9.1.15 and MCP server 8.4.13.
allow_type_changebooleannoSet true only to really replace an option that holds text with an object or array. Without it that write is refused, because a plugin that decodes its own text option can crash on every page load.
allow_object_overwritebooleannoSet true only to replace an option that stores a PHP object, and only when the new value keeps the same shape. Without it that write is refused.

Example call

The smallest valid call, with the required parameters only:

{
  "name": "wordpress_update_option",
  "arguments": {
    "option": "value",
    "value": "value"
  }
}

Response

{
  "success": true,
  "updated": true,
  "option": "blogname"
}

Change one key and leave the rest

Themes and plugins often keep many settings in one option. Divi keeps about a hundred in et_divi, the footer bar credit among them. Sending the whole value back to change one setting risks the others, and it is refused when the option holds a key or password that was shown as [redacted].

With path, Respira reads the stored option, sets that one key and writes it back. Every other key stays as it was, including ones the agent never saw.

{
  "name": "wordpress_update_option",
  "arguments": {
    "option": "et_divi",
    "path": "custom_footer_credits",
    "value": "Built by Example Studio"
  }
}

The answer carries previous (the old value of that key), value, existed and a snapshot_uuid for undo.

  • The option must already exist and hold an array. A path cannot create an option.
  • A new last key is allowed. A missing key in the middle of the path is refused with respira_option_path_not_found, and a path that runs into text or an object with respira_option_path_not_array.
  • The rules for a whole write apply to the one key: protected options, the type-change rule, and the [redacted] refusal.
  • On a site whose plugin is older than 9.1.15 the MCP server sends nothing and says to update Respira, because an older plugin would store the one value as the whole option.

To find where a setting lives, use respira_find_in_page: for the Divi footer bar credit it names et_divi and custom_footer_credits.

What it changes

It removes or overwrites something on the site, so treat it as the careful kind of call. On a page or post the edit lands on a copy first. The live page changes only when a person approves the copy in wp-admin. Calling it twice with the same arguments leaves the site in the same state as calling it once. On a connection set to read-only it is refused with respira_scope_denied.

When it fails

The failures seen most often on real sites in the last 30 days, most common first:

  • respira_site_id_not_found: No connected site has that ID. Call respira_list_sites and use an ID from the result.
  • respira_redacted_value_in_write: The value contains [redacted], the placeholder shown in place of a key, token or password when an option is read or listed. Writing it would replace the real secret with that text, so nothing is written. Read the option with reveal_secrets: true, which a person approves, then send the full value back. Plugin 9.1.13.

How long it takes

A typical call takes about 2.2 seconds. 19 in 20 finish within 4.6 seconds. Measured on real sites over the last week, so it includes the site's own hosting.

Availability

Works on any WordPress site, whichever page builder it uses. Available since Respira 1.0.0.

Notes

  • Options can affect site behavior; prefer making changes on staging first

Example Prompts

  • "Update the blogname option to 'Respira Demo Site'"
  • "Set the timezone_string option to 'America/New_York'"