This document is for an older version of
Freeform
. View latest version →Console Commands
Freeform includes several console commands to allow you to run cleanup tasks and other tasks.
Purge Commands
These commands let you delete Freeform submission data from the database.
3.8+
Purge SubmissionsAllows 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
3.8+
Purge SpamAllows 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
3.8+
Purge Unfinalized AssetsAllows 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
Field Commands
These commands let you create Freeform fields.
3.12+
Create FieldsAllows 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.myField
.--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:checkbox
checkbox_group
datetime
dynamic_recipients
email
file
file_drag_and_drop
hidden
invisible
multiple_select
number
opinion_scale
phone
radio_group
rating
regex
select
signature
table
text
textarea
website
./craft freeform/fields/create --label="My Field" --iterations=5 --type=select