DOCS · 06 · UPDATED 2026-10allwpcare.com/plugins/welltend-snapshots/docs/wp-cli/
Docs

WP-CLI commands

Reference for every wp awc config command, flag and exit code: export, import, diff, restore and snapshot create, list and delete.

Updated Oct 17, 2026

All commands live under wp awc config. wp awc is the shared command namespace for AllWPCare plugins, so future family plugins add their own subcommands next to this one. It does not touch wp config, which is WP-CLI's own command for wp-config.php. The text below follows the help that WP-CLI prints for each command.

Terminal
wp awc config --help
Output
SYNOPSIS  wp awc config <command>SUBCOMMANDS  diff          Show differences between two sources.  export        Export settings as deterministic, redacted JSON.  import        Import settings from an export file.  restore       Restore a snapshot.  snapshot      Manage stored snapshots.

WP-CLI's global parameters work as usual. Two are worth knowing: --path=<path> points at the WordPress install, and --user=<id|login|email> sets the user recorded as the author of a snapshot (without it, the snapshot's author is 0).

Choosing what to include: --sources#

Wherever a command takes --sources=<ids>, give a comma-separated list. Each entry is either an exact provider id or a group:

You writeIt selects
core.generalexactly that source
core or core.*every source whose id starts with core.
pluginevery plugin source
plugin.woocommerceall five WooCommerce sources
other or other.optionsOther plugin and theme settings
core,plugin.yoastthe two selectors combined

An entry that matches nothing is an error: Unknown settings source "nope". The full id list is on Supported plugins and settings. Leaving --sources out selects every source that is available on this site.

wp awc config export#

Synopsis
wp awc config export [--sources=<ids>] [--include-env] [--file=<path>]

Export settings as deterministic, redacted JSON.

FlagMeaning
--sources=<ids>Comma-separated provider ids or groups (for example core,plugin.yoast). Default: all.
--include-envInclude environment keys: siteurl, home, admin_email, upload_path and upload_url_path.
--file=<path>Write to a file instead of standard output. Prints Exported N sources to <path>.
Terminal
wp awc config export --file=settings.json

With no --file, the JSON goes to standard output with nothing else mixed in, so redirecting it is safe.

wp awc config import#

Synopsis
wp awc config import <file> [--sources=<ids>] [--only=<settings>] [--all-other] [--include-env] [--force] [--mirror] [--dry-run] [--accept-risky] [--yes]

Import settings from an export file. Takes a safety snapshot first (undo with wp awc config restore).

FlagMeaning
<file>Path to the JSON export.
--sources=<ids>Only these providers.
--only=<settings>Only these settings, as comma-separated provider:key pairs, for example core.general:blogname,other.options:my_plugin_settings.
--all-otherAlso import every difference in Other plugin and theme settings. Without it (or naming them with --only) they are left as they are.
--include-envAlso apply environment keys present in the file.
--forceApply sources exported from a different major plugin version.
--mirrorMake each group in the file replace the group on the site. By default settings the file does not name stay as they are.
--dry-runShow what would change and exit.
--accept-riskyAllow security-sensitive changes (sign-up role, email sender, other plugin and theme settings). --yes alone is not enough.
--yesDo not ask for confirmation.

The command prints the list of changes, then asks Apply these changes? A safety snapshot is taken first. [y/n]. Answering anything but y ends the command with exit status 0 and no changes. On success it prints:

Output
Success: Applied 2 changes. Undo with: wp awc config restore 26

If nothing differs it prints Nothing to change. and takes no snapshot. Warnings (skipped sources, ignored settings, security-sensitive changes) are printed before the prompt, and sources skipped at apply time are repeated after it. See Diff and restore.

wp awc config restore#

Synopsis
wp awc config restore <snapshot-id> [--sources=<ids>] [--only=<settings>] [--all-other] [--include-env] [--force] [--dry-run] [--accept-risky] [--yes]

Restore a snapshot.

FlagMeaning
<snapshot-id>Snapshot id (see wp awc config snapshot list).
--sources=<ids>Only these providers.
--only=<settings>Only these settings, as comma-separated provider:key pairs. Other plugin and theme settings are named by option: other.options:my_plugin_settings.
--all-otherAlso restore every difference in Other plugin and theme settings.
--include-envAlso write environment settings (site URL, home URL, admin email). Safety copies taken before an import that changed them restore these automatically.
--forceApply sources recorded under a different major plugin version.
--dry-runShow what would change and exit.
--accept-riskyAllow security-sensitive changes (sign-up role, email sender, other plugin and theme settings). --yes alone is not enough.
--yesDo not ask for confirmation.

The safety copy is labelled Before restoring snapshot #<id>. To undo a restore, restore the safety copy whose id the command printed.

Other plugin and theme settings from the terminal#

A plain restore or import never writes Other plugin and theme settings (other.options). The command lists how many of them differ and leaves them alone. Name the ones you want, or take them all, and confirm the risk:

Terminal
wp awc config restore 24 --dry-runwp awc config restore 24 --only=other.options:my_plugin_settings --accept-riskywp awc config restore 24 --all-other --accept-risky

--sources=other.options on its own is refused with a message, because it does not say which settings to write. Option names may contain dots; after other.options: the whole rest is one option name.

wp awc config diff#

Synopsis
wp awc config diff <a> [<b>] [--sources=<ids>] [--format=<format>]

Show differences between two sources. Each of <a> and <b> is a snapshot id or a path to an export file. <b> defaults to the current site.

FlagMeaning
<a>Snapshot id or file.
<b>Snapshot id or file. Default: current settings.
--sources=<ids>Only these providers.
--format=<format>text (default) or json.

The text format lists each area with a sentence per change, then a line with the count of redacted secrets, then Success: No differences. when there are none. The json format prints the complete comparison: has_differences, total, sentences, and for each area its label, count, changes (each with type, path, path_string, from, to, sentence) and redacted.

Terminal
wp awc config diff 24
Output
General settings (core.general)  - Site title changed from 'testplugins' to 'Harbor Bakery'.Reading settings (core.reading)  - Blog pages show at most changed from 10 to 12.7 secret values are redacted and were not compared.

diff is made for scripts. For example, a CI job that fails when production has drifted from the committed file:

CI step
wp awc config diff settings.json --sources=core,plugin || echo "Settings have drifted"

wp awc config snapshot create#

Synopsis
wp awc config snapshot create [--label=<label>] [--sources=<ids>] [--include-env] [--porcelain]

Create a snapshot of the current settings.

FlagMeaning
--label=<label>Label for the snapshot.
--sources=<ids>Only these providers.
--include-envInclude environment keys.
--porcelainOutput just the snapshot id.
Terminal
wp awc config snapshot create --label="Before plugin update"
Output
Success: Created snapshot 25.

With --porcelain the output is only 25, which is handy in scripts: ID=$(wp awc config snapshot create --porcelain).

wp awc config snapshot list#

Synopsis
wp awc config snapshot list [--format=<format>]

List snapshots, newest first (at most 500). Columns: id, created_at, origin, label, size (bytes of stored JSON).

--format is table (default), json, csv or ids (one snapshot id per line).

wp awc config snapshot delete#

Synopsis
wp awc config snapshot delete <id> [--yes] [--force]

Delete one snapshot. It takes exactly one id; call it once per snapshot. It asks you to confirm first; add --yes to skip the question (for scripts). Prints Deleted snapshot <id>.

The newest safety copy, the one taken before your last restore, is how you undo that restore. It is only deleted when you also add --force.

Exit codes#

Command012
exportExportedUnknown --sources, file could not be written, settings could not be encoded
importApplied, nothing to change, dry run, or you answered noValidation failed (nothing changed), safety snapshot or apply failedFile unreadable
restoreSame as importSnapshot not found, validation failed, apply failed
diffNo differencesDifferences foundFile missing or unreadable, snapshot not found, unknown --sources, a file that is not valid JSON or not an export
snapshot createCreatedSnapshot could not be saved
snapshot listListed
snapshot deleteDeletedSnapshot not found

For diff, treat 1 as "different" and 2 as a problem with your input, so CI can rely on exit 1 meaning differences.