elementor/update-custom-code updates fields on an existing Elementor Pro Custom Code snippet.
Requires Elementor Pro. Without it the ability reports that plainly rather than failing obscurely.
At a glance
| Ability | elementor/update-custom-code |
| Toolset | Elementor — toolset/elementor |
| Group | Elementor › Custom Code |
| Requires | Elementor, active on the site |
| Capability | manage_options |
| Safety | Writes data |
| Repeatable | Idempotent — running it twice leaves the same result |
| Ships in | AcrossAI Abilities Manager 0.0.34 and later |
How it works
A published snippet takes effect on the next request. There is no staging step between the write and the front end, which makes editing a live snippet a live change to what every visitor loads.
The safe pattern for anything substantial is to set the status to draft, make the change, read it back, then publish — three calls rather than one, and no window where broken code is live.
Changing the location is the edit most likely to have consequences beyond the snippet. Moving a script from body end to head makes it render-blocking; moving one the other way can break something that depended on running early.
The code field replaces the body entirely. There is no append, so read it first if you mean to add to it.
Idempotent.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
code_id | integer | Yes | The snippet to change. |
title | string | No | A new title. |
code | string | No | Replacement code. Replaces the body entirely. |
location | string | No | A new injection location. |
priority | integer | No | A new priority. |
status | string | No | A new status. |
What comes back
| Name | Type | What it is |
|---|---|---|
code_id | integer | The snippet changed. |
updated | array | Which fields changed. |
success | boolean | Whether the call completed. |
message | string | A one-line summary of what happened, suitable for showing a human. |
error_code | string | Present only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation. |
Example
Ask your assistant:
Move the analytics snippet to the body end.
It resolves to one call:
{
"ability": "elementor/update-custom-code",
"parameters": {
"code_id": 880,
"location": "wp_body_end"
}
}Worth knowing
- A published snippet changes for every visitor on the next request.
- Draft, edit, read back, publish — for anything substantial.
- The code field replaces; there is no append.
- Requires Elementor Pro.
Related abilities
- Get Elementor Pro Custom Code — read before replacing
- Delete Elementor Pro Custom Code — remove it instead
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category