For a long time, I have searched for a plugin that will delete posts that are over a certain 'age' (eg. 30 days old). What is the best way to do this?
相关问题
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- Display product ACF field value in Woocommerce tra
- php PDO::FETCH_ASSOC doesnt detect select after ba
Reference
Here's some SQL that will find every post that has been around for 30 days or more:
To delete all the posts, you can replace
SELECT * FROM
withDELETE FROM
— but make sure you take a backup before you do this!You can then just
cron
that however you like, be that a shell script, a PHP script, or whatever you're most comfortable with.Delete 30 days old post command is :