30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

Create Elementor Pro Custom Code

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

Abilityelementor/create-custom-code
ToolsetElementor — toolset/elementor
GroupElementor › Custom Code
RequiresElementor, active on the site
Capabilitymanage_options
SafetyWrites data
RepeatableNot idempotent — each call changes the row set, so re-running is not a no-op
Ships inAcrossAI 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

NameTypeRequiredWhat it is
titlestringYesThe snippet title.
codestringYesThe markup or script to inject.
locationstringNoWhere to inject it.
priorityintegerNoOrder within the location.
statusstringNoPublication status.

What comes back

NameTypeWhat it is
code_idintegerThe new snippet.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent 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


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading