WP-CLI Commands
FormGlut adds WP-CLI commands for working with forms and entries from the command line.
Stats
wp formglut stats
Shows how many forms and entries there are.
List forms
wp formglut forms list [--status=<status>] [--format=<format>]
| Option | What it does |
|---|---|
--status | Only forms with this status: active, draft or closed. |
--format | table (default), csv, json, yaml or count. |
Example: wp formglut forms list --status=active
List entries
wp formglut entries list --form=<id> [--status=<status>] [--limit=<number>] [--format=<format>]
| Option | What it does |
|---|---|
--form | Required. The form ID. |
--status | unread, read, spam or trash. Default: everything except spam and trash. |
--limit | Newest entries only. Default: 20. |
--format | table (default), csv, json, yaml or count. |
Example: wp formglut entries list --form=12 --limit=5
Export entries to CSV
wp formglut entries export --form=<id> [--file=<path>] [--status=<status>]
| Option | What it does |
|---|---|
--form | Required. The form ID. |
--file | Where to write. Default: formglut-entries-<id>-<date>.csv in the current folder. |
--status | unread, read, spam or trash. Default: everything except spam and trash. |
Example: wp formglut entries export --form=12 --file=/tmp/contact.csv
Delete spam
wp formglut entries delete-spam [--form=<id>] [--yes]
Permanently deletes spam entries and their uploaded files.
| Option | What it does |
|---|---|
--form | Only this form. |
--yes | Do not ask for confirmation. |
