elementor/create-custom-code creates a new Elementor Pro Custom Code snippet with a title, code, location, priority and status.
Requires Elementor Pro. Without it the ability reports that plainly rather than failing obscurely.
At a glance
| Ability | elementor/create-custom-code |
| Toolset | Elementor — toolset/elementor |
| Group | Elementor › Custom Code |
| Requires | Elementor, active on the site |
| Capability | manage_options |
| Safety | Writes data |
| Repeatable | Not idempotent — each call changes the row set, so re-running is not a no-op |
| Ships in | AcrossAI Abilities Manager 0.0.34 and later |
What the location decides
Head, body start or body end. The choice is about when the code runs relative to the page rendering, and it has performance consequences: a synchronous script in the head delays every page’s first paint.
Most third-party tags that insist on the head do so out of habit rather than necessity. Body end is the default worth preferring unless something genuinely needs to run first.
Priority orders snippets within a location, which matters when one depends on another — a tag manager before the tags it configures.
Creating as a draft is the safe pattern. A published snippet runs on the next request; a draft one does not, which leaves room to read what was created before it is live.
The code is arbitrary markup and script. It runs on the front end of the site with whatever access that implies, and a snippet created from a description is a snippet nobody has read.
Not idempotent.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
title | string | Yes | The snippet title. |
code | string | Yes | The markup or script to inject. |
location | string | No | Where to inject it. |
priority | integer | No | Order within the location. |
status | string | No | Publication status. |
What comes back
| Name | Type | What it is |
|---|---|---|
code_id | integer | The new snippet. |
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:
Add our new analytics tag as a custom code snippet.
It resolves to one call:
{
"ability": "elementor/create-custom-code",
"parameters": {
"title": "Analytics",
"code": "<script src=\"https://example.com/a.js\" defer></script>",
"location": "wp_body_end",
"status": "draft"
}
}Worth knowing
- Prefer body end. Head injection delays first paint.
- Priority orders snippets that depend on each other.
- Create as a draft and publish after reading it.
- Requires Elementor Pro.
Related abilities
- Update Elementor Pro Custom Code — publish or change it
- List Elementor Pro Custom Code — see what already exists
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category