I have created a custom post similar to WordPress posts that I want to delete automatically every time (for example, every day or every week).
Is there a function for this?
I know that you can delete trash posts with the following function
define('EMPTY_TRASH_DAYS', 10 );
But what about custom created posts?
Thanks for your help
2
Answers
You can delete published posts every week by setting up a
wp_schedule_event
Hope this code helps
I think, this code will full fill your requirements.