Global Variables
New in v3.14.1. Elementor 4.2 introduced Global Variables: typed design tokens (colors, fonts, sizes) that widgets reference by stable id, separate from the older kit-settings presets on the Global settings page. These tools drive Elementor’s own Variables service directly — no raw meta writes — so validation, soft deletion, and CSS cache invalidation all stay under Elementor’s control.
Requires Elementor 4.2+ with the Variables module active. All six tools are free tier.
emcp-tools/list-variables
Section titled “emcp-tools/list-variables”Lists every Global Variable: id, label, value, type, order, and the current watermark (a version counter used to prevent conflicting writes, see below).
Input:
include_deleted(boolean, optional) — include soft-deleted variables that can still be restored.
Returns: { count, variables, types, watermark, version }. types is the list of variable types this Elementor install actually supports (typically global-color-variable, global-font-variable, global-size-variable, global-custom-size-variable) — call this first to know what’s valid before creating one.
Read-only, enabled by default.
emcp-tools/create-variable
Section titled “emcp-tools/create-variable”Input:
type(required) — one of the types fromlist-variableslabel(required) — CSS custom-property name, no spaces, 50 characters maxvalue(required) — 512 characters max
Returns: the new variable’s stable id and the updated watermark.
Disabled by default (write).
emcp-tools/update-variable
Section titled “emcp-tools/update-variable”Input:
id(required)label,value(required — both must be sent even if only one changes)type,order(optional)
Disabled by default (write).
emcp-tools/delete-variable
Section titled “emcp-tools/delete-variable”Soft-deletes a variable. Existing references may stop resolving until it’s restored.
Input:
id(required)confirm: true(required)
Disabled by default, destructive.
emcp-tools/restore-variable
Section titled “emcp-tools/restore-variable”Restores a soft-deleted variable, optionally overriding its label, value, or a compatible type.
Input:
id(required)label,value,type(optional overrides)
Disabled by default (write).
emcp-tools/batch-variables
Section titled “emcp-tools/batch-variables”Applies multiple create/update/delete/restore operations atomically — all or nothing.
Input:
watermark(required) — fromlist-variables; the batch is rejected with astale_watermarkerror (409) if variables changed since you listed them, so you don’t overwrite a concurrent edit blindoperations(required) — array of{ type: "create"|"update"|"delete"|"restore", ...same fields as the single-item tools above }confirm: true— required if any operation is a delete
Disabled by default, destructive.
Errors
Section titled “Errors”Beyond the usual validation errors, expect Elementor’s own domain errors surfaced with clear codes: variable_limit_reached, duplicated_label, type_mismatch, invalid_variable, batch_operation_failed, and variable_not_found (404). kit_not_found (404) means no active Elementor kit exists yet — visit Elementor → Site Settings once to initialize it.
Always call list-variables before a batch write. The returned watermark is your concurrency guard, and types tells you exactly which variable types this site’s Elementor version supports before you try to create one.