To remove any post that is older than X days in WordPress you can use the query below.
Sample mySQL
DELETE FROM wp_posts WHERE post_type = 'post' AND DATEDIFF(NOW(), post_date) > X
To remove any post that is older than X days in WordPress you can use the query below.
DELETE FROM wp_posts WHERE post_type = 'post' AND DATEDIFF(NOW(), post_date) > X