Auto-close comments

Here’s a WordPress plugin that closes comments on all posts older than 21 days: Auto-Close Comments.

It runs a query and update against the database when any one of the following occur:

  • A post is published (but not saved as a draft), edited or deleted;
  • A comments is posted, edited or deleted;
  • A trackback is posted; or
  • A template is saved


  1. S

    I’ve never understood that; what’s the rationale behind wanting to close off comments?

    I’m just curious because a lot of blogging topics are pretty timeless and since you get e-mail notification of all comments anyway, why would you want to stop anyone from striking up conversation?

    — S.

  2. Katja (Post author)

    Because the older the post, the more likely that any comment received on it will be spam.

    That jives with my experience – when I get these blitzes of comment spam, they’re almost always on old posts.

    But on the other hand, do I want to cut off even one legitimate comment? Is it too big a barrier to assume that people can figure out how to get to a more recent post, contact form or email address to make their comment?

    What if, instead of just saying “Comments are closed on this post”, it were to say something friendlier?

  3. Katja (Post author)

    You’ve definitely got me thinking about this. One idea, gleaned from a discussion at, is to figure out a way to moderate comments on old posts, but allow unmoderated commenting on newer posts.

  4. Patricia Tryon

    Blogger should get that.

    (I favor a friendly remark like “Better never than late.” ;-) )

  5. S

    Hmm… I’ve actually never gotten comment spam from LJ, but yeah, I can definitely understand that =P

    My preference would be to get a better spam blocker and try to leave comments as free and open as possible.

    — S.

  6. S

    > figure out a way to moderate comments on old posts, but allow unmoderated commenting on newer posts.

    That doesn’t look too hard… I’m thinking:

    – set the default comment_status for recent entries to “open”

    – then tweak line 28 of the plugin to “SET comment_status = ‘moderated'” (or whatever the moderated status string actually is)

    — S.

  7. Katja (Post author)

    The auto-moderate plugin first checks the date of the last comment on the post, then the last edit of the post, then the create date of the post.


Leave a Comment

Your email address will not be published. Required fields are marked *