For reference, here is the clunky method I came up with.
- Export the entries to a file:
wp gf entry export 198 --start_date=21-01-01 --end_date=21-03-31 out.csv
The exported entries for form 198 from Jan 1, 2021 to Mar 31, 2021 to a file out.csv
-
Figure out which column contains the entry ID by viewing the header line of the CSV. In my case, the entry ID was in column 9.
-
I used this command to trash the entries IDs I found in the CSV file:
wp gf entry delete $(awk -F "," '{print $9}' out.csv|sed 's/[^[:digit:]]\+//g'|paste -d\ -s)
You can force the entries to be deleted rather than being put into trash. And you probably want to verify that the export is working as expected, before you try to delete thousands of entries. If you have any other questions, please drop them here. Thank you.