WordPress.org

Ready to get started?Download WordPress

Forums

Auto-delete old comments? (12 posts)

  1. kheldon
    Member
    Posted 8 years ago #

    Hello, I'm wondering how I can autodelete old comments. Say every 90 days or so.

    I've tried finding plugins for it but haven't had any luck.

    Could anybody point me in the right direction?

  2. computerjoe
    Member
    Posted 8 years ago #

    Why do you wish to do this?

  3. kheldon
    Member
    Posted 8 years ago #

    The website I'm creating is using a guestbook function as a buy/sell board. They don't want it to clutter up and would like an automated system that removed the comments (ie ads) to be removed after 90 days.

  4. kheldon
    Member
    Posted 8 years ago #

    I could realy use some help on this one. Anybody have any tips?

  5. pizdin_dim
    Member
    Posted 8 years ago #

    I'm not aware of any plugins to automate the task. Do you have access to your database via some other means than WP? If so, this will work:

    delete from wp_comments where date_sub(now(), interval 90 day) > comment_date;

    Assuming your comments table is called wp_comments of course. I know this is not automated but just run it on a weekly basis or something.

  6. kheldon
    Member
    Posted 8 years ago #

    Well if I can make an easy button in the admin for it, I can skip the automated part.

    I do have database access.

    Not sure how to use the snippet you wrote there though.

  7. humm
    Member
    Posted 8 years ago #

    need to do a manual delete. not yet seen any automatic plugin!

  8. Cypher
    Member
    Posted 8 years ago #

    I've the Auto Delete Posts plugin that could easily be modified to delete comments.

    Regards

  9. kheldon
    Member
    Posted 8 years ago #

    Very cool. =) Would you happen to have the time to help me with the modification? I'm not much of a coder. -_-

  10. Cypher
    Member
    Posted 8 years ago #

    Yeah I should have some time, send me a quick ping through the contact form on my website so we can communicate off-forum.

    Regards

  11. kheldon
    Member
    Posted 8 years ago #

    Sent you a contact-me email, Cypher. Hope you got it.

  12. alrescha
    Member
    Posted 8 years ago #

    Maybe this is a little off-topic, but if the plugin can be modified to, say, configurable to delete configurable posts' comments according to configurable criteria (older than x days, more than n comments etc), then it would be quite a powerful comments management function.

    In particular, what I'm thinking of is a guestbook. People often set up a post to act as a WordPress guestbook, but the comments just go on accumulating. If we have such a plugin, we could set it to delete the guestbook post's oldest comments whenever there's more than 100 comments.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags