Hi @mhugg1961 and @cenzi
Currently, this is not possible out of the box or with snippets.
Achieving something like this would require the modification of some core files, which modifications would be lost after a plugin update.
The query needs to be changed here:
wp-content/plugins/the-events-calendar/src/Tribe/Event_Cleaner_Scheduler.php
In this function select_events_to_purge()
look for this line:
AND t2.meta_value <= DATE_SUB( CURDATE(), INTERVAL %d MONTH )
and change it to:
AND t2.meta_value <= DATE_SUB( CURRENT_TIMESTAMP(), INTERVAL %d MINUTE )
With this change, the ‘1 month’ setting under “Events > Settings > General tab > Move to trash / Permanently delete events older than” will be taken as ‘1 minute’.
(3 months as 3 minutes, etc.)
Also you will need to change the related crons, as the trash and delete actions run on the cron.
- tribe_del_event_cron
- tribe_trash_event_cron
Currently, these are set to run once per day. I would change them to run every 15 minutes. A plugin like WP Crontrol can help you do that.
I would not set it to more often than 15 minutes, unless you have a lot of events to get rid of and a lot of visitors.
With the 15-minute setting, the old events will be trashed or deleted every 15 minutes.
Again, warning, if you make that change in the core file, the change will be lost after a plugin update and you will need to re-do it again.
I also strongly recommend a full backup before attempting this.
If this is something you would like to see as a feature, then I would recommend you to add it to our idea board, or upvote it if it’s already there.
Let me know if this helps.
Cheers,
Andras