• For reasons not worth going into, I’d like to perform a bulk delete of all posts and related comments posted before a certain date. I get error messages each time I try to delete bunches of posts using the WordPress administration panel.

    Can some MySQL guru please provide the query I need to get this done?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mlanger

    (@mlanger)

    Someone suggested

    delete * from wp_posts where post_date < 2010-05-11 02:08:17

    But I’m thinking that it would not deleted associated comments. Can anyone help me with this?

    Hi.
    Im having the same question,
    I got 60.000 posts and I think it’s time to cleanup.

    mlanger,did you find any other info on the topic?

    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);

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘MySQL Query to Delete Posts Before a Certain Date’ is closed to new replies.