Skip to content

push should set _elementor_version post meta to avoid bc-flex-widget compatibility mode #40

@tomatitito

Description

@tomatitito

Problem

When elementor-cli push creates or updates a page, it does not set the _elementor_version WordPress post meta key. Without this key, Elementor assumes the page was built with an older version and adds the elementor-bc-flex-widget CSS class to the page container.

This triggers a backwards-compatibility CSS rule:

.elementor:not(.elementor-bc-flex-widget) .elementor-widget-wrap { display: flex; }

Because elementor-bc-flex-widget is present, the :not() selector doesn't match, and .elementor-widget-wrap falls back to display: block. This breaks any widgets using _element_width: auto (e.g., buttons intended to flow side-by-side), causing them to stack vertically instead.

How to reproduce

  1. Create or push a page with elementor-cli push
  2. Add button widgets with _element_width: auto
  3. Observe that buttons stack vertically instead of flowing horizontally
  4. Compare with a page that was saved through the Elementor editor UI — it has _elementor_version set and displays correctly

Workaround

Manually set the meta via WP-CLI:

wp post meta update <page-id> _elementor_version "3.32.4"

Suggested fix

When elementor-cli push writes a page, it should also set _elementor_version to the installed Elementor version (or at least a recent version). This can be read from wp option get elementor_version or from the Elementor plugin metadata.

Optionally, elementor-cli pull could also include _elementor_version in page.json so it round-trips correctly.

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