Skip to main content
Documentation/Advanced/WP-CLI
Advanced

WP-CLI

Oxygen registers its own WP-CLI command namespace, wp oxygen, on every install. Run wp oxygen from your WordPress root to see the list of available commands.

$ wp oxygen

SUBCOMMANDS

  check_directories       Check directory status
  clear_cache             Clear and regenerate CSS cache
  create_directories      Create required directories for Breakdance
  export_settings         Export Breakdance settings to JSON file
  import_settings         Import Breakdance settings from JSON file
  license                 Set Breakdance license key
  replace_url             Replace URLs in Breakdance content
  soft_reset              Perform a soft reset (refresh icon sets and fallback
                          templates)
  status                  Get Breakdance system status
  theme                   Enable or disable the WordPress theme system
  total_reset             Perform a total reset (reset all settings and
                          reinstall)

Checking the install

wp oxygen status prints a short health summary — whether the directories Oxygen writes
to are all present and writable, which product the codebase is running as, and whether the
copy is licensed:

$ wp oxygen status
Breakdance System Status:
========================
✓ All required directories are properly configured
Mode: oxygen
License: Pro Mode

Directories

Oxygen writes generated files into wp-content/uploads/oxygen/ — cached stylesheets,
custom font files and font stylesheets, and design library data. Two commands cover them:

wp oxygen check_directories    # report which ones are missing or unwritable
wp oxygen create_directories   # create the missing ones

These are the CLI equivalents of the Create Directories button on the
Tools tab.

Regenerating the CSS cache

wp oxygen clear_cache

Saving a page in the builder rebuilds the cached CSS for that page. clear_cache throws
away every cached stylesheet Oxygen has generated.

Replacing URLs after a move

wp oxygen replace_url https://old-site.com https://new-site.com

Absolute URLs get baked into your page data — image sources, links, background images —
so moving a site to a new domain leaves them pointing at the old one. This command
rewrites them in Oxygen's own page data and in your builder preferences, and reports how
many database rows it changed.

It touches Oxygen's page data (the _oxygen_data post meta) and your builder preferences,
and nothing else. Post content, other plugins' options and the rest of the database are
untouched, so a whole-site move still needs a general search-and-replace pass —
wp search-replace handles that.

It's a direct database update with no undo — take a backup first.

Exporting and importing settings

wp oxygen export_settings
wp oxygen export_settings --file=/path/to/settings.json
wp oxygen import_settings /path/to/settings.json

Without --file, the export is written to oxygen_settings_<YYYY-MM-DD>.json in the
current directory.

The file holds everything Oxygen keeps in site options: the settings tabs, your builder
preferences (custom fonts, custom breakpoints), your global selectors and variables — and
their saved revisions, which is why the file can run to a megabyte on a mature site. Your
licence key is deliberately left out. Pages, templates and components aren't in it either;
those are WordPress posts, not settings.

Export the current state before importing a new one:

wp oxygen export_settings --file=before-import.json
wp oxygen import_settings incoming.json
wp oxygen clear_cache

Licence key

wp oxygen license YOUR-LICENSE-KEY
wp oxygen license clear

Setting a key activates it and prints back what the licence server said under a License
Information heading: the product the key is for, whether the key is valid, its activation
state and the expiry date. If the key is stored but comes back anything other than valid,
the command finishes with a warning rather than an error, so the exit status alone isn't
enough — read the Status line. The argument clear removes the stored key instead of
setting one.

Resets

wp oxygen soft_reset
wp oxygen total_reset

soft_reset restores the stock icon sets and re-applies the two settings a fresh
install starts with — the skip link is switched back on, and Oxygen's theme handling is
re-enabled. Any icon set you uploaded yourself is deleted in the process; everything else
on the settings tabs, and all of your content, is left alone.

total_reset deletes every option Oxygen stores and reinstalls the factory defaults.
That is much wider than it sounds: the settings tabs, your builder preferences, your
global selectors and variables, your design library configuration and your licence key
all go. Your content survives — pages, templates, headers, footers and components are
WordPress posts — so this resets Oxygen without uninstalling it. Take an export first if
there is any chance you want the old state back:

wp oxygen export_settings --file=before-reset.json
wp oxygen total_reset

Generating translations for custom elements

If you build your own elements, this extracts their translatable strings into a POT file.
It lives under the breakdance namespace rather than oxygen:

wp breakdance i18n make_pot <plugin-slug> [--domain=<domain>] [--output=<path>] [--skip-audit]

It walks every element.php in the named plugin and collects element names, control
labels, dropdown option text, button-bar labels and preset section labels, then writes a
POT file — by default to <plugin>/languages/<domain>-builder.pot — and prints a summary
of what it found. --skip-audit suppresses that summary.

wp breakdance i18n make_pot my-elements-plugin --domain=my-elements

Troubleshooting

wp: command not found

WP-CLI isn't installed on the server. It's a separate tool from WordPress — most managed
hosts provide it over SSH, and the WP-CLI installation
guide
covers doing it
yourself. Nothing on this page works without it.