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

4 thought on “How to remove any post that is older than X days in WordPress”

Leave a Reply