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.
wp awc config --helpSYNOPSIS 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 write | It selects |
|---|---|
core.general | exactly that source |
core or core.* | every source whose id starts with core. |
plugin | every plugin source |
plugin.woocommerce | all five WooCommerce sources |
other or other.options | Other plugin and theme settings |
core,plugin.yoast | the 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#
wp awc config export [--sources=<ids>] [--include-env] [--file=<path>]Export settings as deterministic, redacted JSON.
| Flag | Meaning |
|---|---|
--sources=<ids> | Comma-separated provider ids or groups (for example core,plugin.yoast). Default: all. |
--include-env | Include 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>. |
wp awc config export --file=settings.jsonWith no --file, the JSON goes to standard output with nothing else mixed in, so redirecting it is safe.
wp awc config import#
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).
| Flag | Meaning |
|---|---|
<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-other | Also import every difference in Other plugin and theme settings. Without it (or naming them with --only) they are left as they are. |
--include-env | Also apply environment keys present in the file. |
--force | Apply sources exported from a different major plugin version. |
--mirror | Make each group in the file replace the group on the site. By default settings the file does not name stay as they are. |
--dry-run | Show what would change and exit. |
--accept-risky | Allow security-sensitive changes (sign-up role, email sender, other plugin and theme settings). --yes alone is not enough. |
--yes | Do 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:
Success: Applied 2 changes. Undo with: wp awc config restore 26If 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#
wp awc config restore <snapshot-id> [--sources=<ids>] [--only=<settings>] [--all-other] [--include-env] [--force] [--dry-run] [--accept-risky] [--yes]Restore a snapshot.
| Flag | Meaning |
|---|---|
<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-other | Also restore every difference in Other plugin and theme settings. |
--include-env | Also write environment settings (site URL, home URL, admin email). Safety copies taken before an import that changed them restore these automatically. |
--force | Apply sources recorded under a different major plugin version. |
--dry-run | Show what would change and exit. |
--accept-risky | Allow security-sensitive changes (sign-up role, email sender, other plugin and theme settings). --yes alone is not enough. |
--yes | Do 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:
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#
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.
| Flag | Meaning |
|---|---|
<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.
wp awc config diff 24General 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:
wp awc config diff settings.json --sources=core,plugin || echo "Settings have drifted"wp awc config snapshot create#
wp awc config snapshot create [--label=<label>] [--sources=<ids>] [--include-env] [--porcelain]Create a snapshot of the current settings.
| Flag | Meaning |
|---|---|
--label=<label> | Label for the snapshot. |
--sources=<ids> | Only these providers. |
--include-env | Include environment keys. |
--porcelain | Output just the snapshot id. |
wp awc config snapshot create --label="Before plugin update"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#
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#
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#
| Command | 0 | 1 | 2 |
|---|---|---|---|
export | Exported | Unknown --sources, file could not be written, settings could not be encoded | |
import | Applied, nothing to change, dry run, or you answered no | Validation failed (nothing changed), safety snapshot or apply failed | File unreadable |
restore | Same as import | Snapshot not found, validation failed, apply failed | |
diff | No differences | Differences found | File missing or unreadable, snapshot not found, unknown --sources, a file that is not valid JSON or not an export |
snapshot create | Created | Snapshot could not be saved | |
snapshot list | Listed | ||
snapshot delete | Deleted | Snapshot 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.