Skip to content

push command overwrites local changes (implicit pull before push) #38

@tomatitito

Description

@tomatitito

Description

When running elementor-cli push <page_id>, the command appears to pull the current state from WordPress before pushing, which overwrites any local changes made to the page JSON file.

Steps to Reproduce

  1. Pull a page: elementor-cli pull 2902
  2. Modify the local JSON file (e.g., .elementor-cli/pages/staging/2902/page.json)
  3. Run elementor-cli push 2902
  4. Check the local file - changes are reverted to match WordPress
  5. Check WordPress - data is unchanged

Expected Behavior

elementor-cli push should push the local JSON to WordPress without first pulling/syncing from WordPress.

Actual Behavior

The push command reports success, but:

  • Local file is reverted to match WordPress state
  • WordPress data remains unchanged

Workaround

Update WordPress directly via WP-CLI:

cat .elementor-cli/pages/staging/2902/page.json | jq -c '.elementor_data' | \
  podman exec -i juki-wp bash -c 'cat > /tmp/data.json && wp post meta update 2902 _elementor_data "$(cat /tmp/data.json)" --allow-root'

podman exec juki-wp wp elementor flush-css --allow-root

Suggested Fix

Either:

  1. Remove the implicit pull before push
  2. Add a --force or --no-pull flag to skip the pull step
  3. Add a --dry-run flag to preview what would be pushed

Related

GitHub Actions run: https://github.com/tomatitito/elementor-cli/actions/runs/22023181059/job/63635530677?pr=36

Environment

  • elementor-cli version: (please add)
  • Node.js version: (please add)
  • OS: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions