bookmark_borderManaging Forms with WP-CLI

Creating Forms

Example

wp gf form create 'My Form Title' 'Description Here'

Parameters

  • title
    The title of the new form.

  • description
    The description of the new form.

Deleting Forms

Example

wp gf form delete 5 --force

Parameters

  • form-id
    The ID of the form to be deleted.

  • –force
    Skips the trash and permanently deletes the form.

Duplicating Forms

Example

wp gf form duplicate 5

Parameters

  • form-id
    The ID of the form to duplicate.

Editing Forms

Example

wp gf form edit 5

Parameters

  • form-id
    The ID of the form to edit

Exporting Forms

Example

wp gf form export 5 --dir=/my/custom/path

Parameters

  • form-id
    The ID of the form to export. If not set, exports all forms.

  • –dir=
    The path to the location that the export should be stored. Defaults to current working directory.

Listing Forms

Example

wp gf form form_list --active --sort_column=id --format=json

Parameters

  • –active
    List active forms. Defaults to true.

  • –trash
    List forms in trash. Defaults to false.

  • –sort-column=
    The column to sort the list by. Accepted values are id, title, date_created, is_active, and is_trash. Defaults to id.

  • –format=
    Defines the format in which the forms will be listed. Accepted values are table, csv, json, and count. Defaults to table.

Getting Forms

Example

wp gf form get 5

Parameters

  • form-id
    The ID of the form to get.

Importing Forms

Example

wp gf form import /path/to/my/file.json

Parameters

  • json-path
    The path to your JSON file to import

Updating Forms

Example

wp gf form update 5 --form-json={parameter: "value"}

Parameters

  • form-id
    The ID of the form to update.

  • –form-json=
    The JSON representation of the form.