WP-CLI
OctaForms ships a small set of WP-CLI commands, all under wp octa-forms. They are the right tool for cron jobs, deploy scripts and CI.
Queue commands
Section titled “Queue commands”Drain the delivery queue now. This is the command to run from a system cron. See Cron and the delivery queue.
wp octa-forms queue drainShow the queue’s current state (backlog, worker health):
wp octa-forms queue statusTheme sync commands
Section titled “Theme sync commands”These import form definitions that ship as JSON in your theme. The full workflow is covered in Forms in your theme (sync).
Show the sync status of every theme form file:
wp octa-forms theme statusImport forms from the theme into the database:
wp octa-forms theme import --all # import every file; exits non-zero on any failure (good for CI)wp octa-forms theme import --slug=contact # import one formwp octa-forms theme import --all --force # also overwrite conflictsImport never deletes anything. Removing a theme file leaves the form in the database untouched.
Export and import commands
Section titled “Export and import commands”These move forms between sites with an export file, the same file the Import & export screen uses. See Export and import forms.
Export every form, or only some, to a file. Without --file the JSON is printed:
wp octa-forms forms export --file=forms.jsonwp octa-forms forms export --slug=contact,offer > forms.jsonImport a file. New forms are imported. --on-conflict decides what happens to a form whose slug already exists: skip (the default), replace or copy. A callback widget form is never copied.
wp octa-forms forms import forms.json --dry-run # show what would happenwp octa-forms forms import forms.json # import new forms, skip existing oneswp octa-forms forms import forms.json --on-conflict=replace # also replace existing formsImported forms are published with every email and webhook turned off, exactly as on the screen. The command exits non-zero when any form fails to import.