Freeform includes several console commands to allow you to run cleanup tasks and other tasks.
These commands let you delete Freeform submission data from the database.
Allows you to purge all submissions older than a specific number of days. Freeform automatically attempts to execute this service based on the specified number of days for the Automatically Purge Submission Data setting.
./craft freeform/purge/submissions --age-in-days=30
Allows you to purge all spam submissions older than a specific number of days. Freeform automatically attempts to execute this service based on the specified number of days for the Automatically Purge Spam Submissions setting.
./craft freeform/purge/spam --age-in-days=30
Purge Unfinalized Assets
Allows you to purge all unfinalized assets older than a specific number of minutes. Freeform automatically attempts to execute this service every 3 hours.
./craft freeform/purge/unfinalized-assets --age-in-minutes=180
These commands let you create Freeform fields.
Allows you to create new fields from the command line.
--label="My Field"- the name of the field to be created. Handles will automatically be converted as camel case to match, e.g.
--iterations=5(optional) - the number of fields you'd like created as this type and set. Additional fields will be automatically suffixed with numbers, e.g.
My Field, My Field 1, My Field 2.
--type=select- the field type you'd like the new field to be created as. Options are:
./craft freeform/fields/create --label="My Field" --iterations=5 --type=select