Elementor integrates with WP-CLI, enabling you to run certain Elementor tasks via the command line. Currently, the following Elementor commands that are integrated with WP-CLI are:
flush_css – Flush the Elementor Website Builder CSS Cacheimport_library – Import template files to the libraryreplace_urls – Replace old URLs with new URLs in all Elementor pagessync_library – Sync Elementor Librarylicense activate or license deactivate – Activate or Deactivate Elementor Pro license
To view a list of all available Elementor WP-CLI tools via the command line, enter:
wp help elementor
wp help elementor
wp help elementor-pro
wp help elementor-pro
To get help for an individual command, use the format:
wp help elementor
or
wp help elementor-pro
flush_css
wp help elementor flush_css
Successful Response:
import_library
wp help elementor import_library
Note: For the wp elementor import_library command, the name of the admin user has to be added for security reasons. Without the inclusion of the admin』s username, it will trigger an 「access denied」 error.
For example:
Do Use This: wp elementor import_library import-test.zip --user=admin
Don』t Use This: wp elementor import_library import-test.zip
replace_urls
wp help elementor replace_urls
sync_library
wp help elementor sync_library
Successful Response:
license activate
Note that this differs from the rest, as it uses elementor-pro rather than elementor.
wp elementor-pro license activate
Successful Response:
license deactivate
Note that this differs from the rest, as it uses elementor-pro rather than elementor.
wp elementor-pro license deactivate
Successful Response:
Tip: Type 「q」 to quit / leave help and return to the command line.