The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group
Automatic delete entries by day, hours, minute etc...
This only work on Linux server, or you can use same idea on Windows Server.
- Connecting via SSH to your server
- Create sql file on your server nano drop_formidable_entries.sql and save it on any location that you want. exp: /home/formidable
- Insert example the following queries inside the sql file:
use wordpress;
DELETE FROM wp_frm_items WHERE form_id=x and created_at < (NOW() - INTERVAL 1 MINUTE);wordpress: it's database name.
wp_frm_items: it's table name
form_id=x: input form id that you wanted delete entries from it.
1 MINUTE: in this case will delete all entries from form id x older than 1 minute. You can change it into HOUR, DAY, WEEK or etc. For more value click here - Save it
- In command line type crontab -e to add cron job into system, with following command.
*/30 * * * * /usr/bin/mysql < /home/formidable/drop_formidable_entries.sql >/dev/null 2>&1
Here */30 mean every 30 minutes will delete entries. You can change it as you want. For crontab generator click hereNB: If you have cPanel or Plesk you can simple create file and cron job inside cPanel or Plesk control panel. It's easy as command line.
August 1, 2017 at 2:08 pm
Thanks for posting, Hozhan!
August 31, 2017 at 9:29 pm
I can't wait to try this out. Will probably get back with some questions. I guess you need to know what country/timezone your host is in and offset this to local time?
September 1, 2017 at 1:15 am
@John yes if your hosting/server time are not the same as your local time.
But in my example, you don't need to know hosting/server time if you want delete older than 1 minute. If you want older than 1 hours, then you need only change 1 to 60.
Discussion closed.