wp_update_theme_mod
Updates one registered top-level Customizer theme mod for the active theme using its permissions, validation, sanitization and save API. Read wp_get_theme_mod first and pass its stylesheet. Requires confirm=true after user approval. Unregistered settings, option settings and indexed settings are not supported. Returns observed persisted before/after values; verify the rendered site separately.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"site_id": "<site_id>",
"name": "<name>",
"value": "<value>",
"stylesheet": "<stylesheet>",
"confirm": "<confirm>"
},
"name": "wp_update_theme_mod"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Exact registered theme mod name, e.g. header_button_text. | |
| value | Yes | New value, validated and sanitized by the registered Customizer setting. | |
| confirm | Yes | Must be true after the user approves the theme setting change. | |
| site_id | Yes | The connected site's id returned by list_sites. Call list_sites first; do not use a URL or WordPress post ID. | |
| stylesheet | Yes | Expected active stylesheet from wp_get_theme_mod. |