@AlistairReid Nice one -- reminds me of those recursive pictures (you know, a photo of a photo of a photo ...) http://tinyurl.com/5r3wkk in reply to AlistairReid 8 hrs ago

Comment Timeout

Comment Timeout closes comments on old posts on your blog. It takes into account ongoing discussions by allowing you to keep comments open for longer if you have recently had any comments. Version 2.0 is a complete rewrite from the ground up with some new features:

  • Per-post settings: You can set a longer (or shorter) duration for the discussion on particular posts, or even designate some posts to have comments kept open indefinitely.
  • Extended discussions for popular posts: You can set a cutoff number of comments above which a post is automatically considered “popular” and entitled to have comments left open for a longer period of time.
  • Send to moderation queue: You have the choice between closing comments altogether on older posts or sending them to the moderation queue.
  • Advance warning: The comment form now informs your users when the discussion will be closed.

Note: The functionality introduced in version 1.3 to trap BBCode and too many hyperlinks is now in a separate plugin, Link Limits. The functionality to close comments across the board to IP addresses that are persistently causing problems is in another plugin called Three Strikes and You’re Out.

Download

Installation

  • Unzip the contents of the archive and copy the comment-timeout directory and all its contents into your wp-content/plugins directory.
  • Activate the plugin in your WordPress dashboard.
  • Go to the “Comment Timeout” page under “Options” to set the timeout options.

Configuration

The configuration page looks a bit different from version 1.0, but the options are all fairly straightforward:

  • Allow comments on posts less than x days old: This indicates how long to leave comments open after a post has been published. If no comments are received during this time, the comment form will be closed. The default is 120 days.
  • Also allow comments until x days after last approved comment: This indicates how long to leave comments open after the last approved comment in the discussion. Comments in the moderation queue, spam and deleted comments are not counted. The default is 60 days. If you do not want the discussion extended when comments are received, set this to zero.
  • Or on popular posts until x days after last approved comment: Same as the above, but for popular posts. If you don’t want to consider any posts to be “popular”, set this value to the same as the previous one.
  • Where “popular” means at least x approved comments: This indicates how many comments a post must have in order to be considered “popular” and entitled to the longer interval between comments. The default is to increase the timeout to 365 days after 20 comments.
  • On older posts: When this is set to "Close comments", the comment form will be closed on older posts and any attempts to post a comment will be rejected. When it is set to “Send to moderation queue”, the comment form will remain open, but all comments on older posts will be flagged for moderation. The default is to close comments.
  • Trackbacks and pingbacks: When this is set to “Treat as comments” (the default), trackbacks and pingbacks will be lumped together with the comments in the calculations. When it is set to “Handle independently”, they will be subject to the same rules as the comments, but treated separately, so if you are getting a lot of comments but few trackbacks, trackbacks may close before comments, or vice versa. “Do not time out” means that trackbacks and pingbacks remain open indefinitely, regardless of what happens to the comments.
  • Apply these rules to pages, images and file uploads: This indicates that these rules should be applied to anything that isn’t a post within your blog chronology, i.e. pages, images and file uploads. If you uncheck this, pages that have comments open will have them kept open indefinitely by default.
  • Allow individual posts to override these settings: This indicates that individual posts should be allowed to specify their own timeout values. If you are not using this option, you can gain a little performance by turning it off, as it uses an extra database query on each request.

Per-post settings

When it is enabled, Comment Timeout adds an extra box to the sidebar in your “Write post” or “Write page” pages in the dashboard. This gives you options to use the default settings, keep comments open indefinitely (”don’t close comments”), or specify individual timeouts for the discussion. Note that posts that have their own timeout settings do not have an option to check for popularity. Note: On Firefox, if you reorder the boxes in the sidebar, the check mark on the radio buttons will disappear. This appears to be a bug in either WordPress itself, or the browser(s) concerned (I have not determined which), not Comment Timeout: the “Post status” box behaves in the same way. I have not yet determined exactly which other browsers are affected.

Requirements

Comment Timeout requires WordPress 2.0 or later. It does not work with WordPress 1.5. If you run into problems, I’ve written a blog entry on how to report problems with WordPress plugins. Please read it and do what it says before shouting at me!

Issues

My theme breaks when comments are closed!
This is almost certainly due to a faulty theme. Some theme designers do not test their themes properly when comments are closed, either by this plugin or by manually disabling comments within WordPress. See this blog entry for more details.

65 comments:

  • 7 Jun 2007
    14:38

    is this supported in wp2.2?

  • 7 Jun 2007
    14:40

    Yes. I’m using it here on my own blog, which is running WordPress 2.2.

  • 7 Jun 2007
    15:30

    oh goody… i am now flooded by spam… this gonna work… hehe cool

  • 7 Jun 2007
    15:52

    Try Link Limits as well. I’ve found that about 80% of spam has BBCode or hyperlinks in abundance. Bad Behavior and Akismet are also absolute essentials for mopping up the remainder.

  • 7 Jun 2007
    16:13

    oh… its not that effective for me… the spam i get only has 2 links at the most… this plugin in is enough as the affected posts are way way back…

  • 8 Jun 2007
    09:13

    I’ll give your plugin a shot on my site to cut down the daily comments keeping me up to date on viagra news as this gets really boring.

  • 12 Jun 2007
    16:44

    When a spam comment is eliminated does it get saved in the database as spam or is it just deleted?

  • 13 Jun 2007
    09:36

    You can set that as an option in the configuration page. Comments on older posts can either be rejected outright or sent to the moderation queue.

  • 28 Jun 2007
    12:54

    I really love this plugin. Very professionally done.

    is there a way to tweak it to have the option to close comments when the comment count gets to a certain number?

    This isn’t to battle spam.

  • 29 Jun 2007
    09:11

    Hmmm, I did have that facility in version 1.x but I didn’t think it was any use to anyone so I’ve removed it in the first alpha of 2.0. Does anyone else think I should put it back?

  • 5 Jul 2007
    00:29

    This is great and just what I was looking for. Considering I’m over 115,000 blocked spam comments from Akismet, and most of my spam comments coming on old posts, this is going to be really helpful.

    As for Jesse’s idea… not sure how useful that would be personally, seems kind of an arbitrary idea — that might make sense for huge comment blogs like TechCrunch where you’d want to cap it at, say 50 comments across the board, but I think that belongs in a separate plugin… maybe “Max Comments”?

  • 21 Jul 2007
    16:25

    Akismet catches virtually all my spam, so what I’m really looking for is a way to reduce overhead — there have been times when I got so much spam (thousands per hour) that it set off the cpu usage alarms at my host and got my site repeatedly suspended for a few minutes. So I’m wondering if blocking the comments would reduce the amount of cpu time that spammers consume when they’re hammering the comments-post script. Any thoughts?

  • 22 Aug 2007
    08:57

    For me, Akismet was once starving, now it’s struggling with overfeeding of spam. This should come in handy )

  • 24 Aug 2007
    19:09

    Great plugin, many thanks! It has consideraby reduced the ammount of comment spam I am getting… but I’m not sure if ti related to this plugin, but I don’t get any pingbacks anymore, roughly since the time I installed the plugin. I see the PBs in the xmlrpc.log file, but they seem to get lost on the way from there…?
    thx
    Tom

  • 25 Aug 2007
    10:03

    I’ve found the reason for the missing pingbacks; it is not related with your plugin. -)
    thanks for the good work!

  • 25 Aug 2007
    17:14

    I seem to be coming up against an issue with this plugin. (Or at least, I think it’s this plugin, as the issue goes away when I deactivate it.)

    Anyway, the basic problem is that whenever you submit a comment, instead of the comment being accepted, the submitter is being sent to a wordpress error page that says “Sorry, comments are closed for this item.”

    This happens regardless of how old the post is. It also happens even when it’s clearly stated next to the submit post box that the comments aren’t due to close for another month, or whatever.

    The very odd thing though, and the main reason why I suspect this to be some odd bug, is because if I change the option “For older posts” from “close comments” to “send to moderation queue”, then the comments go to moderation. IE the plugin is treating every single post as if it is “old” but it is still allowing the comments to be submitted. (On the actual old posts the comments submission form is not shown, as designed.)

    I honestly cannot explain this bug.

    For info -

    Disabled all other plugins, no change.
    Server Apache/1.3.34 (Unix) mod_become/1.3 DAV/1.0.3 mod_perl/1.29 PHP/4.3.9 mod_fastcgi/2.4.2
    PHP v4.3.9
    MYSQL v4.1.10a AND version 4.1.22-log

    Tested both with logged in user and non-logged in user, on various browsers.

    Any ideas?

  • 25 Aug 2007
    18:34

    Ok, I’ve done a bit more digging at this and compared the current version of your plugin with the last one I had. I found this line in preprocess_comments

    $post = get_post($comment['comment_post_ID']);

    Which in the old version was like this

    $post = get_post($comment->comment_post_ID);

    I changed the current plugin to the line in the old code with the -> character and commenting works again. I switch it back, and it breaks. I do not know enough about PHP to say why this is the case, or if my fix is valid. Any ideas?

  • 28 Aug 2007
    12:50

    @mrmist: The change you suggested actually undoes a fix for a bug that was allowing spam bots to sneak past the protection. Anyone who is not experiencing the same problem should not apply this change. Anyone who is experiencing this problem, please let me know.

    You haven’t told me which version of WordPress you are using. I will need to know this. Also, do you know whether you have enabled the WordPress cache?

    I’m on holiday at the moment and don’t have my laptop with me but I will look into this when I get back next week.

  • 28 Aug 2007
    17:36

    Ahh ok. I guess that’s not a great fix then. Unfortunately without the “fix” I can’t use the plugin at all. (

    I have a feeling that not many people are being affected, because surely you would have heard more responses?

    Anyway it’s wordpress 2.2.2, no cache.

    Enjoy your holiday!

  • 31 Aug 2007
    10:07

    i tryied your plugin and is really nice. thank you for your work

  • 31 Aug 2007
    16:03

    I loved the comment limit per post option, but it’s gone in the new version.. WHY? (

  • 2 Sep 2007
    16:50

    Hi James, I’m back! )

    I have just uploaded and activated “Comment Timeout” and realized that once activated, WordPress will no longer send me emails whenever somebody leaves me a comment. And once I deactivated the plugin, I received email notifications whenever a new comment is posted.

    Is this a bug?

  • 4 Sep 2007
    04:12

    Hi James,

    Try on the plugin, seems like I can reply the comments when I am logged in to my wordpress admin.

    It kept saying this “Sorry, comments are closed for this item.”

    I am using the latest version of the plugin

  • OHR
    11 Sep 2007
    01:54

    Is there asp version for the script? Thanks

  • 11 Sep 2007
    18:49

    Love it, love it, love it!!

    The plug-in seems to be working really well.

  • 11 Sep 2007
    19:36

    @Josie: are you looking for Link Limits?

    @OHR: No, this is WordPress specific. I know that some ASP.NET blog software such as Subtext and dasBlog have automatic comment closing functionality but it is not quite so flexible. If it’s classic ASP you mean, do people still use that? )

    @Pelf: I might have known you’d show up — you seem to be pretty good at putting me through the mill! Which other plugins are you using? It may be related to the problem that some other people have been reporting about it erroneously closing comments.

    @Everyone else who has reported problems: I take it you are all on PHP 4 — is this correct? Sorry for the delay in tackling this one — I should be able to give it some attention in the next few days now that I am back from holiday.

  • 12 Sep 2007
    20:27

    Yeah mine is 4.3.9. No worries about the delay, real life quite often takes over from blogworld.

  • spanish
    17 Sep 2007
    14:34

    Why has the comment limit per post bit gone ??? - I loved it and its not there in the new edition -(

  • 20 Sep 2007
    02:14

    Excellent plugin - thanks!

  • Josie
    25 Sep 2007
    10:14

    Thanks for your reply, I’m not looking for link limits. I’m looking for a setting that let me limit the number of comments per post. For example I want to close comments after 30 comments in a post!

  • Tom
    25 Sep 2007
    20:45

    Thanks for the plugin. A good and usefull help for my blog…

  • 26 Sep 2007
    19:30

    I also just got the error message “Sorry, comments are closed for this item” even on new posts.

    I modified the preprocess_comment($comment) function.

    Replace:$post = get_post($comment['comment_post_ID']);
    With: $post = get_post($comment->comment_post_ID);

    It works now.

  • 27 Sep 2007
    00:14

    @Josie: It seems there is a demand for this feature — I will probably either restore it in version 2.1 or release it as a separate plugin. What does everyone think?

    @Daniel: As I mentioned above, I don’t think that this is the problem. However, I have spotted something that may be causing problems. A couple of lines further down, the line that says:

    $isClosed = $isPing ? ($post->comment_status == 'closed') : ($post->ping_status == 'closed');

    should actually say this:

    $isClosed = $isPing ? ($post->ping_status == 'closed') : ($post->comment_status == 'closed');

    I’ve corrected this in version 2.0.1. Can you let me know if it makes a difference?

  • 27 Sep 2007
    10:31

    Hi James, does commet-timeout work well with wp 2.3? Could you consider including it in the official compatibility list?

    http://codex.wordpress.org/Plugins/Plugin_Compatibility/2.3

  • 27 Sep 2007
    12:09

    I haven’t tested it with WordPress 2.3 yet — haven’t had time — but I expect that it should work. If anyone can confirm that it does or runs across any issues, let me know and I will look into it when I get a chance.

  • 27 Sep 2007
    18:42

    I have blog in Wordpress 2.2.3 and this plugin work great. Thank’s

  • 29 Sep 2007
    09:01

    Hello!

    Pleasingly, the fix above seems to have worked in my case. I also suppose that it explains why not everyone experienced the bug, because it would depend if you allow pings or not.

    So 2.0.1 seems good for me.

  • 29 Sep 2007
    11:40

    I’ve just upgraded to WordPress 2.3 and Comment Timeout 2.0.1, and initially it seems to be working. Comments on old posts seem to be blocked, comments on new ones not. Of course, I upgraded about ten minutes ago, so I’ve not been able to check for more subtle problems, but it doesn’t crash the system.

  • 30 Sep 2007
    11:52

    Maybe another simple plugin would be great. But in the meanwhile… can you give me a download link (or send it to my mail) to the previous version of comment timeout where the comment limit option was available? Thank youuuu!

  • 30 Sep 2007
    20:45

    It’s available here.

  • 1 Oct 2007
    14:03

    Thank youuu )

  • 10 Oct 2007
    07:37

    Hi, thanks for the plugin & for the fix (it certainly happens when pingbacks are disabled).
    I have a feature-request, just a suggetion: I’d like the ‘add to moderation queue’ option to apply to older posts but not all. I mean adding a number of days after which the comments are just closed.
    So the schedule for a post would be: Comments open | comments on pop. post | moderation queue | comments closed.
    smile

  • 10 Oct 2007
    09:10

    Hmmm, I’m not too sure about that one — it’s probably over-complicating things, though if there is sufficient demand for it I may consider it.

    Then again I could always let Zawinski’s Law prevail and expand it until it can read mail…

  • 12 Oct 2007
    23:28

    When someone accesses the trackback address on a closed post (say, mysite.com/somepost/trackback), they get redirected to the post itself (mysite.com/somepost/). Can this plugin, or WordPress itself, be configured to return a 403 or 404 in this case?

  • 13 Oct 2007
    00:00

    @Eric: Off the top of my head, I think that’s a feature of the WordPress core rather than CT. You’d probably need another plugin to do what you’re asking.

    @Josie and anyone else who’s interested: you may be interested to know that there is already another plugin called Cap Comments that places a limit on the number of comments in a blog post. I haven’t tried it myself so I don’t know how well it works.

  • Todd Prouty
    20 Oct 2007
    00:15

    Suggested feature: The ability to change the date format shown in the “Comments for this post will be closed on…” message via the admin.

    I was able to change the date to a typical American format (”February 11, 2008″) by editing the line 525 in comment-timeout.php (v 2.0), changing this:

    echo 'on ' . date('j F Y', $ct1);

    to this:

    echo 'on ' . date('F j, Y', $ct1);

    However, more “plug & play” users may have trouble with this, so having a choice of some common date formats would be nice. For the do-it-yourselfers that aren’t familiar with date formatting, here’s some more info on date and time in WordPress.

  • 25 Oct 2007
    22:07

    Great plug-in James! smile Works great and is easy to use!

    One question though: I’m running a Dutch website. I’ve managed to change the message ‘Comments for this post will be closed’ to a Dutch sentence, but the names of the months are still in English. The site uses the Dutch language, but your plug-in doesn’t seem to care about that and keeps it in English. smile Is there a way to change this so that also the name of the months of your plug-in are in Dutch?

    Thanks in advance!

    Joram, The Netherlands

  • Overige
    14 Nov 2007
    12:39

    Hi,

    Thanks for this great plugin, it works great.

    I’ve got one question: How do i translate the date? My whole blog is in Dutch (including the date and time). When viewing the plugin the date is in englisch ? ??: How to retrieve dutch times as used in WP???

    Regards!

  • 18 Nov 2007
    00:19

    Hi James,

    Fantastic plug-in, thank you for your continued work on it. I’m wondering if it has the capability to change the placement of the ‘Comments for this post will expire…’ text in a template? I’m redesigning and would like to integrate the output with my design, since at the moment it’s just tacked automatically at the bottom.

    Could you include a ‘template tag’ (oh I hate that term in Wordpress) to override the automatic insertion?

  • 2 Jan 2008
    00:17

    Thanks for the plugin! Is it compatible with Wordpress 2.3.2?

  • 31 Jan 2008
    17:45

    It is compatible with WordPress 2.3, yes.

  • Kaylee
    28 Feb 2008
    14:03

    hi James,
    Is this comment plug-in compatible with different than WP programme? as currently im using a tool name BLUEVODA to create my website. Do this plug-in also support BLUEVODA??

  • 28 Feb 2008
    17:40

    Unfortunately not — it’s WordPress specific.

  • Dan
    24 Mar 2008
    18:48

    James,

    Thank you very much for your software! I’ve been wondering how I would handle the situation of people posting on my old posts. Now I know! I’m going to add it to my blog.

  • Claus
    5 Apr 2008
    11:04

    What about a version officially compatible with 2.5?

  • 5 Apr 2008
    12:55

    I haven’t tested it properly on WordPress 2.5 yet, but as far as I am aware, it should work correctly without modification.

  • Gene
    10 Apr 2008
    04:37

    Hi James,

    I’m building a “Newspaper” type of site using WP 2.3.3 (Will not upgrade till 2.51 is out, 2.5 is buggy) and will be installing this plugin but before I do, would it affect the number of comments on pages also? And would it interfere with DMSGuestbook, which uses it’s own templates?

    Thanks,
    Gene

  • 7 Jun 2008
    19:55

    By default it doesn’t apply to pages, but you can change this either on the configuration settings page or on a post-by-post or page-by-page basis if you wish.

    I have no idea about DMSGuestbook — I’ve never used it, so unfortunately I can’t give any specific guidelines.

  • Karl Bedford
    13 Jul 2008
    16:50

    Great plugin, just one question: Is there a way I can place the ‘Comments for this post will be closed on 25 September 2008.’ where I want to in my comment area?

    Many thanks,
    Karl

  • 21 Jul 2008
    16:04

    Well nice to know this

  • 1 Aug 2008
    21:26

    Is this plug-in compatible with WP 2.6?

  • 1 Aug 2008
    21:27

    I only ask because our last comment closer plugin was not, and don’t want to waste any time if this one is not. Thanks.

  • 9 Aug 2008
    00:41

    just in case somebody want’s to know….
    this plugin works perrrrfectly fine with 2.5
    I haven’t tried it with 2.6 since this WP version is so full of bugs…but that’s a another story

    Thanks a lot for this plugin…I was looking a very long time for such a thing…where in gods name have you been hidden -)

    Greets from Luxembourg

  • 17 Oct 2008
    15:29

    Hi! A friend of mine suggested this plugin to help reduce spam and I love it except that when I install it, it removes all the comments from my old posts. I’m using 2.6.2. Is this a compatibility issue?

  • 13 Nov 2008
    12:49

    Thanks James. Seems to work fine in 2.6.3!

RSS feed for comments on this entryAdd your comments



(Personal blogs only please: leave blank if you don't have one)

Your comments:

-) razz mad lol cool ??? shock sad smile

Maximum 2 links per comment. Do not use BBCode.