Clear ACF Field Value
Explicitly clears a field to empty, or resets it to the field's configured default value.
| Property | Value |
|---|---|
| Ability slug | mosmcp/clear-field-value |
| Wire tool name | mosmcp__clear-field-value |
| Category | Advanced Custom Fields (mosmcp-acf) |
| Plan | Free |
Required access
| Requirement | Value |
|---|---|
| Capability | edit_posts, edit_post (checked against the specific post) |
| Minimum default role | Contributor |
| Requires | Advanced Custom Fields |
| Annotations | readOnly: false · destructive: false · idempotent: true · openWorld: true |
Input schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| field_key | string | Yes | — | Field name or key to clear. |
| post_id | integer | Yes | — | Post/page/CPT entry the field belongs to. |
| reset_to | string (one of empty, field_default) |
empty |
Whether to clear to empty or reset to the field default. |
Output schema
| Field | Type | Required |
|---|---|---|
| success | boolean | |
| resulting_value | string \| number \| integer \| boolean \| array \| object \| null |
Example
Sample prompt
Reset the 'color' field on post 42 back to its default.
Example request (json)
{
"jsonrpc": "2.0",
"id": 412,
"method": "tools/call",
"params": {
"name": "mosmcp__clear-field-value",
"arguments": {
"input": {
"field_key": "color",
"post_id": 42,
"reset_to": "field_default"
}
}
}
}Example response (json)
{
"jsonrpc": "2.0",
"id": 412,
"result": {
"isError": false,
"structuredContent": {
"success": true,
"resulting_value": "red"
}
}
}
Edge cases / errors
- reset_to: empty (default) → saves a type-appropriate empty value: an empty array for checkbox, relationship, gallery, repeater, flexible content and multi-select fields, otherwise an empty string.
- reset_to: field_default on a field with no configured default → falls back to the empty value.
- Missing post → acfa_invalid_post; unknown field → acfa_field_not_found; no edit access to the post → permission refused.
| << Previous | Next >> |
|---|---|
| Bulk Update ACF Fields | Create ACF Field Group |
For more information about the Secure MCP Server for WordPress plugin, explore the following resources:
Product Overview | Pricing | Try for Free | Documentation
If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.