Skip to main content

WP-CLI Commands

Core Forms 4.4 registers three command groups under wp core-forms: form for form definitions, submission for bulk submission maintenance, and license for the license-issuing commerce records. The commands are available whenever the plugin is active and WP-CLI is installed.

Two conventions apply throughout:

  • --dry-run — commands that change data support a dry run that reports what would happen without touching anything. Run with --dry-run first, review the count, then run again without it.
  • --yes — destructive commands ask for confirmation before proceeding. Pass --yes to skip the prompt in scripts and cron jobs.

List-style commands accept --format=<format> with the standard WP-CLI formats: table (default), json, csv, yaml, ids, or count.

Forms

wp core-forms form list

Lists all forms with their ID, title, slug, and status.

Option Description
--status=<status> Filter by post status. Default: any.
--format=<format> Output format. Default: table.
wp core-forms form list
wp core-forms form list --status=publish --format=json

wp core-forms form export

Exports form definitions — title, slug, status, markup, settings, and message overrides — as portable JSON with a schema version and the plugin version stamped in.

Option Description
[<ids>...] One or more form IDs. Omit to export every form.
--output=<file> Write JSON to a file instead of STDOUT.
# Export everything to STDOUT
wp core-forms form export

# Export two specific forms to a file
wp core-forms form export 12 15 --output=forms.json

Unknown IDs produce a warning and are skipped; the rest of the export continues.

wp core-forms form import

Imports a Core Forms JSON export. Each form in the file becomes a new core-form post — existing forms are never overwritten, and slugs are made unique automatically.

Option Description
<file> Path to the JSON export, or - to read from STDIN.
--status=<status> Override the post status of every imported form.
--dry-run Validate the file and report the form count without inserting anything.
# Validate first
wp core-forms form import forms.json --dry-run

# Import for real, everything as drafts
wp core-forms form import forms.json --status=draft

# Pipe between sites
wp @staging core-forms form export | wp @production core-forms form import -

Submissions

wp core-forms submission list

Lists submissions with ID, form ID, status, spam flag, and submission time.

Option Description
--form=<id> Only submissions for this form.
--status=<status> Filter by submission status.
--before=<date> Only submissions before this date.
--limit=<number> Maximum rows. Default 100, capped at 10000.
--format=<format> Output format. Default: table.
wp core-forms submission list --form=12 --format=json
wp core-forms submission list --status=new --before=2026-01-01 --limit=500

wp core-forms submission update

Mass-updates the status of every submission matching the filters.

Option Description
--status=<current> Required. Current status to match.
--set-status=<new> Required. Status to set.
--form=<id> Restrict to one form.
--before=<date> Restrict to submissions before this date.
--dry-run Report the match count without updating.
--yes Skip the confirmation prompt.
# Preview: how many "new" submissions would be archived?
wp core-forms submission update --status=new --set-status=archived --dry-run

# Archive everything older than six months on form 12, no prompt
wp core-forms submission update --status=new --set-status=archived \
  --form=12 --before="6 months ago" --yes

wp core-forms submission cleanup

Permanently deletes old housekeeping records: draft/partial submissions, action logs, email logs, and completed/failed action-queue rows older than the cutoff.

Option Description
--days=<days> Age cutoff in days. Default: 90.
--dry-run Report the total record count without deleting.
--yes Skip the confirmation prompt.
wp core-forms submission cleanup --days=90 --dry-run
wp core-forms submission cleanup --days=180 --yes

Deletion is permanent — there is no trash for these tables, so always dry-run first.

Licensing

These commands inspect and maintain the license-issuing server records.

wp core-forms license product-list

Lists products with ID, slug, name, version, type, status, and activation limit. Accepts --format.

wp core-forms license product-create

Creates a product in the licensing catalog.

Option Description
<name> Required. Product name.
--slug=<slug> Unique slug. Defaults to a sanitized version of the name.
--version=<version> Initial version. Default: 1.0.0.
--type=<type> plugin, theme, or digital. Default: plugin.
--activation-limit=<number> Site activations per license. Default: 1.
wp core-forms license product-create "Acme SEO Pro" \
  --slug=acme-seo-pro --version=2.1.0 --type=plugin --activation-limit=5

wp core-forms license plan-list

Lists pricing plans joined with their product: price (minor units), currency, billing period, and interval. Accepts --format.

wp core-forms license license-list

Lists issued license keys with product, customer email, status, activation limit, and expiry.

Option Description
--limit=<number> Maximum rows, newest first. Default 500, capped at 5000.
--format=<format> Output format. Default: table.
wp core-forms license license-list --limit=50 --format=csv

wp core-forms license order-list

Lists the 500 most recent commerce orders: order number, customer email, status, currency, total (minor units), payment provider and ID, and paid timestamp. Accepts --format.

wp core-forms license maintenance

Runs expiration maintenance immediately (the same job normally handled on cron): expires overdue subscriptions and licenses and reports the counts.

wp core-forms license maintenance

Related