WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] My Sql Delete Before Certain Date (1 post)

  1. diragusa
    Member
    Posted 2 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic