Configuration file format and local file structure for elementor-cli.
Location: .elementor-cli.yaml (project root)
Important: Add to .gitignore - this file contains credentials.
# Default site for commands when --site is not specified
defaultSite: production
# Remote WordPress sites
sites:
production:
url: https://my-friends-site.de
username: admin
appPassword: xxxx xxxx xxxx xxxx xxxx xxxx
# Auto-create revision before every push (default: false)
createRevisions: true
# Container running WordPress (for CSS cache flush via WP-CLI)
container:
runtime: docker # "docker" or "podman"
name: my-wordpress-container
staging-remote:
url: https://staging.my-friends-site.de
username: admin
appPassword: yyyy yyyy yyyy yyyy yyyy yyyy
createRevisions: false # Fast iteration on staging
# Local staging environment configuration
staging:
# Path to docker-compose.yml (relative to project root)
path: ./docker
# WordPress service name in docker-compose.yml
service: wordpress
# Local staging URL
url: http://localhost:8080
# WP-CLI command (useful if wp is not in PATH or uses a different name)
wpCommand: wp # or "php wp-cli.phar" or path to wp-cli
# Container runtime for staging commands (default: "docker")
containerRuntime: docker # "docker" or "podman"
# Local pages storage directory
pagesDir: .elementor-cli/pagesEach site requires:
| Field | Required | Description |
|---|---|---|
url |
Yes | WordPress site URL (must be HTTPS) |
username |
Yes | WordPress admin username |
appPassword |
Yes | Application Password (generate in WordPress admin) |
createRevisions |
No | Auto-create revision before push (default: false) |
container |
No | Container config for WP-CLI CSS flush (see below) |
If a site runs inside a Docker/Podman container, configure container to enable WP-CLI-based CSS cache flushing after push:
| Field | Required | Description |
|---|---|---|
runtime |
Yes | Container runtime: "docker" or "podman" |
name |
Yes | Container name or ID |
| Field | Default | Description |
|---|---|---|
path |
.elementor-cli/staging |
Path to docker-compose.yml |
service |
wordpress |
WordPress service name in compose file (which container has WP-CLI) |
url |
http://localhost:8080 |
Local staging URL |
wpCommand |
wp |
WP-CLI command to use (e.g., php wp-cli.phar if wp is not in PATH) |
containerRuntime |
docker |
Container runtime for staging commands: "docker" or "podman" |
- Log into WordPress admin
- Go to Users → Profile
- Scroll to Application Passwords
- Enter a name (e.g., "elementor-cli")
- Click Add New Application Password
- Copy the generated password (spaces included)
WordPress only allows Application Passwords over HTTPS by default. For local development environments using HTTP, you need to install a must-use plugin.
Create the file wp-content/mu-plugins/enable-app-passwords-http.php:
<?php
// Enable Application Passwords over HTTP for local development
add_filter('wp_is_application_passwords_available', '__return_true');
add_filter('application_password_is_api_request', '__return_true');Warning: Only use this on local development environments. Never deploy this to production sites.
my-project/
├── .elementor-cli.yaml # Project config (add to .gitignore!)
├── .elementor-cli/
│ ├── pages/
│ │ └── production/ # Per-site storage
│ │ ├── 42/
│ │ │ ├── page.json # Complete page data
│ │ │ ├── elements.json # Editable element tree
│ │ │ ├── settings.json # Page settings
│ │ │ └── meta.json # Title, slug, status
│ │ └── 156/
│ │ └── ...
│ ├── dumps/ # Database dumps
│ │ ├── staging-2024-01-27-143052.sql
│ │ └── production-2024-01-26-091530.sql
│ ├── staging/ # Only if using 'preview init'
│ │ └── docker-compose.yml
│ └── templates/ # Starter templates
│ ├── blank.json
│ └── landing-page.json
├── docker/ # Your existing Docker setup (example)
│ └── docker-compose.yml
└── .gitignore # Should include .elementor-cli.yaml
When you pull a page, it's stored in multiple files for easier editing:
Complete page data snapshot:
{
"id": 42,
"title": "Home",
"slug": "home",
"status": "publish",
"elementor_data": [...],
"page_settings": {...},
"pulled_at": "2024-01-27T12:00:00Z",
"remote_modified": "2024-01-15T10:30:00Z"
}Just the Elementor element tree - this is what you edit:
[
{
"id": "abc123",
"elType": "container",
"settings": {...},
"elements": [...]
}
]Page-level settings:
{
"background_background": "classic",
"background_color": "#ffffff",
"padding": {...}
}WordPress post metadata:
{
"title": "Home",
"slug": "home",
"status": "publish"
}Add these to your .gitignore:
# Elementor CLI credentials
.elementor-cli.yaml
# Database dumps (optional - may want to keep these)
.elementor-cli/dumps/
# Local staging environment
.elementor-cli/staging/Keep page data in git if you want version control:
# Track page changes in git
!.elementor-cli/pages/