Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I run a contest/giveaway blog at www.mommylivingthelifeofriley.com and currently have over 160,000 comments on 1100 posts. I would like to find a way to delete all comments from my site which are older than 6 months, so as to improve my site's overall performance. Does anyone have any ideas on how to accomplish this? Thanks for your help!

share|improve this question

1 Answer 1

You could easily do this using mysql:

DELETE FROM wp_comments WHERE comment_date < DATE_ADD(CURDATE(), INTERVAL -6 MONTH)
share|improve this answer
4  
just keep in mind that you may orphan some newer child comments by deleting their older parents. –  Milo Apr 28 '11 at 19:56
    
I might have time to create simple plugin for this. But, I have questions: what's the best solution for old comments that has new childs? should the old comment be deleted along with it's childs? or should it be preserved? or maybe something better (that I don't know yet)? –  ariefbayu Apr 29 '11 at 0:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.