WP-CLI

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 Cache
  • import_library – Import template files to the library
  • replace_urls – Replace old URLs with new URLs in all Elementor pages
  • sync_library – Sync Elementor Library
  • license 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 <command_name>

or

wp help elementor-pro <command_name>


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 <license-key>

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.

Share it on social networks

Share on facebook
Share on twitter
Share on linkedin
Share on email
Was this article helpful?

Get Started With Elementor Today

Join millions of professionals who use Elementor to build WordPress websites faster and better than ever before

On this page