Support » Fixing WordPress » My Sql Delete Before Certain Date

  • Resolved diragusa


    I recently saw this query for deleting posts from a certain date.

    I got this to work. This will delete posts older than 6 months from the current time and date. Obviously you can change the interval to whatever you need.

    delete from wp_posts where post_date < DATE_SUB(NOW(), INTERVAL 6 MONTH)

    Does this do what it says? im looking for something that deletes any post before the present day. and it would do that everyday prferably.
    Im very limited in php, and mysql. but how would you implement this. and as such will this only run once?

  • The topic ‘My Sql Delete Before Certain Date’ is closed to new replies.