Here is some SQL that will find every message that has been around 30 days or more:
SELECT * FROM `wp_posts`
WHERE `post_type` = 'post'
AND DATEDIFF(NOW(), `post_date`) > 30
To delete all messages, you can replace SELECT * FROMwith DELETE FROM- but before doing this, make a backup!
Then you can just cronwhat you like, whether it's a shell script, a PHP script, or whatever you like best.
source
share