New: Comment Timeout version 2.0 is now available, with some new features, notably that you can now set the discussion time out on individual posts if desired. Two other new plugins, Link Limits and Three Strikes and You’re Out, are also available incorporating some of the functionality of Comment Timeout 1.3.
Comment Timeout 1.3 is still available for download but is no longer supported.
Comment Timeout is a WordPress plugin that allows you to selectively close comments on your blog to help reduce spam. There are three ways in which it can do this:
- It lets you close comments on old entries that do not have an ongoing, active discussion.
- It examines your spam queue and your Bad Behavior logs to let you close comments and trackbacks across the board to troublesome IP addresses.
- It allows you to reject comments that contain too many hyperlinks, or links in BBCode format.
It comes with an administration page and is fully configurable.
The latest stable version is 1.3 beta 2. Older versions are no longer supported.
Download: Version 1.3 beta 2
Closing comments on old posts
Some blogs have hundreds or even thousands of entries, dating back several years, many of which have never had a genuine comment — yet they get spammed just as heavily as any of the others. These can be safely closed off without too much trouble. On the other hand, you may want to keep the discussion open on more popular posts. Comment Timeout allows you to do both. Normally it will close discussions after a certain period of time, but if you have recently had comments on posts, you can set it to keep the discussion open for a bit longer.
Spam queue and Bad Behavior integration
(new in version 1.3) Akismet and Bad Behavior are two of the most popular weapons against spam in the blogger’s arsenal, and together they do an effective job of stopping all the nefarious stuff getting onto your blog. Comment Timeout can now be set to look at your spam queue and Bad Behavior logs and see if the IP address of your visitor is the same as one that’s been causing you trouble recently — for instance, by getting more than three comments into your spam moderation queue, or by being blocked by Bad Behavior once too often in the past seven days. If either of these are the case, it can close off comments for that IP address alone for a while.
This should protect your blog if a spam flood gets underway.
Rejecting comments with BBCode or too many hyperlinks
(new in version 1.3) The third option that I included was one to allow you to reject comments altogether if they contain too many hyperlinks. WordPress already has a similar option, but it only allows you to send these comments to your moderation queue; it doesn’t allow you to nuke them altogether.
How many is “too many” will vary from one blog to the next. Most blogs can get away with setting this to a very low figure — I rarely see a genuine blog comment anywhere that contains more than two hyperlinks — though understandably, some people would prefer to set it a bit higher. However, once you get five or more hyperlinks in a blog comment, it is extremely unlikely to be a genuine comment.
Another option is to reject any comments outright if they contain BBCode links. BBCode is a cut-down markup language used on many forum systems. It represents hyperlinks as
[url=http://www.example.com]Some spammy link[/url]
A substantial majority of spam contains hyperlinks in this format, although WordPress does not actually use BBCode. So by rejecting comments which contain BBCode links in this format, we can eliminate a large chunk of spam.
Installation
Download: Version 1.3 beta 2
1. Download the archive using one of the links above.
2. Extract the file CommentTimeout.php into your wp-content/plugins directory.
3. Enable it in your control panel.
4. Navigate to the “Options” tab on your WordPress control panel, then “Comment timeout”.
5. Set your preferences.
6. You’re done!
Configuration
The default settings are to shut off comments, trackbacks and pingbacks on posts four months after posting, or two months after the last comment, whichever is the later, with no limit on the total number of comments in the discussion. Pages remain open for comments indefinitely. If you want to change these settings, there is a configuration page under the “Options” tab. You need to have admin rights on the blog to alter the configuration.
Compatibility
The current version of Comment Timeout works on WordPress 2.0 or later with either PHP 4 or PHP 5. It does not work with WordPress 1.5.
The present version has not been tested on WordPress MU. However, the original version, which required PHP 5 to work properly, was adapted for WordPress MU by Patrick Chia.
Known issues
Issues and new features are tracked on www.wp-plugins.org.
- After upgrading from version 1.3 alpha 1 or 1.3 alpha 2, you may need to double check the plugin’s configuration page: please see this blog post for details.
- No distinction is made between comments, trackbacks and pingbacks in calculating the cut-off date for commenting. This may cause comments to be re-opened after a trackback if you leave trackbacks and pingbacks open. (Ticket #586)
- The bug where it was still showing the comment form on older posts has been fixed for almost all cases that I am aware of, but if anyone is still having problems with it showing the comment form on older posts, I would be interested to know. (Ticket #587)
Legal stuff
Comment Timeout is released under the GNU General Public License, version 2.

RSS feed


15:42
Thanks for this plugin … and the 29 Dec update.
21:22
I’ve enabled this, but it isn’t working. I’ve gone back through the directions (very simple – thank you) and did it all.
Anything I may be missing?
08:04
Doesn’t seem to be doing anything for me with WordPress 2.1 and a custom theme… any tips?
08:30
I think this may be a PHP 4 issue but I’ll need to do a bit more testing to confirm this. I’ll check it out over the weekend. It works on PHP 5 though.
00:30
I can confirm that there was an issue with PHP 4 which did not affect PHP 5. I’ve fixed it in 1.0 release candidate 1 (follow the link above to download).
Apologies to all!
03:42
I downloaded CT a few days ago and it didn’t work, however I downloaded it again and it is working now!
Thanks so much! This is a very helpful plugin.
08:42
thanks so much for writing this plugin!
21:09
Actually it does work for me after all, I was confused by the comment form still *appearing* – but if you try to submit a comment it won’t let you.
That’s great! Now I have no comment spam (when combined with Akismet AND a captcha plugin… I hate those spammers)
21:12
aha just got the latest RC1 version and now have a more useful “the comment form is closed at this time”.
That is absolutely TOP NOTCH stuff – thanks!
21:23
Yes, I did see a report from somewhere else that it was rejecting comments after the deadline although it was still showing the comment form. That’s still a bug though — it should be hiding your comment form and reporting “Comments closed”, just as it would if you were to turn off comments manually in your individual post’s settings.
This bug should be fixed in the latest versions (1.0 rc2 and 1.2 alpha 2). Let me know if it’s still misbehaving in any way.
16:00
I tested it with WP 1.5, and it doesn’t work.
Maybe I should upgrade…
17:00
No, it needs WordPress 2.0 or later. Unfortunately, supporting WP 1.5 and earlier is fairly low on my list of priorities — if you haven’t upgraded, you really should, for security reasons if nothing else.
17:49
Thanks for this extremely useful plug-in. I’m using WordPress 2.1 and the plug-in 1.0 release candidate 2, and though it works beautifully, I have the same bug that Bubb reported: the comments box still appears, but the then sees “the comment form is closed at this time”.
16:40
I’m having the same issue as Sage Tyrtle. Tried downloading 1.3 alpha and still no change. Any suggestions? Thanks.
23:08
This has been getting me scratching my head a bit because I haven’t been able to replicate it — and I’ve had some reports from people saying that it had been fixed successfully. However, admittedly the way I was setting the comment status in the posts to “closed” was a bit of a hack, and I discovered this evening that WordPress does actually provide a better way to do it. I’m using the new approach in version 1.3 alpha 2 — hopefully that should fix it, but let me know if it doesn’t.
For those of you who are technically minded and know a bit about PHP and WordPress internals, I’ve posted a brief explanation here.
10:58
Just downloaded and installed version 1.3 alpha 2 and it works perfectly! Thanks so much for creating this plugin and taking the time to address the issues I had with it.
14:21
php4, wp208, ct1.3-alpha 2: old posts still display a comment input form, but when you submit a comment, it replies “comments are closed”
I would suggest that a “comments closed” info in the post page, without a comment input form, is more appropriate.
Anyway a very useful plugin, kudos to the author, and looking forward to next releases.
14:21
It’s supposed to hide the comment form on old posts. I’m surprised you’re still encountering this problem in 1.3 alpha 2, since I’ve had confirmation from two people that this was fixed in that version. If anyone else is still having the same problem, I’d be interested to know.
I’m also a bit confused about which version of WordPress you’re using. AFAIK there’s no such version as 2.0.8 — it went from 2.0.7 to 2.1.20:47
I just installed and activated the alpha-2 version of this plug-in. Bravo! It works very, very well. One problem, and it’s just a little inconvenient because I’m very self-referential–it seems that anytime there is a ping-back to a previous post, the comments form does not disappear in that post, even though no comment can be posted. “Comments on this post are now closed. Warning: Cannot modify header information – headers already sent by…” appears when you try to post a comment into these. I can manually fix those, however.
Thank you for very, very useful code.
01:16
This plugin is causing this error message to popup when someone tries to place a comment on a current post:
Your comment was rejected as an anti-spam measure as your IP address has changed since you viewed the post. Note that this can happen if you are accessing the Internet through a proxy server, or if you disconnected from the Internet and re-connected.
I disabled the plugin and everything works fine. What would be causing this?
11:36
Disable the last option in the plugin’s admin page — the one which says “Reject comments when the IP address differs from the original page request.”
This is an experimental option that I included in 1.3 alpha. It should stop IP address spoofing by spam bots by making sure that the comment is coming from the same address as served up the original post in the first place. Unfortunately, this causes problems for AOL users in particular, who access the Internet through a shed load of proxy servers that all have different IP addresses, so it should be disabled by default. You may have re-enabled it by mistake.
Does anyone think this feature could be useful? If not I’ll remove it from the next version of the plugin.
12:33
Eric: I think your problem with trackbacks is related to one of the known issues with the plugin. It’s on my to-do list to fix it.
In the meantime there are two ways of dealing with the problem. One of these is to set it to close trackbacks and pingbacks as well as comments on older posts. Another one that you may want to consider is a plugin called No Self Pings. It stops your blog from pinging itself when you link back to one of your older posts. I use it on my own blog because this particular, erm, feature of WordPress is one that I find rather annoying.
21:46
Thanks James, that did the trick. Not using AOL, so I don’t know why it fixed it, but it did.
Thanks so much!
23:21
You’re probably accessing the Internet through a proxy server. I’d imagine that there are other ISPs besides AOL that do this kind of thing.
14:28
it works fine on WP 2.1.1
12:02
Really good plugin, thanks for work.
16:46
Hi James,
I think there may be an issue with PHP 5.2.1.
The message I get is: “Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of preg_match_all(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in /home/xxxxx/xxxxx/xxxxx/wp-content/plugins/CommentTimeout-1/CommentTimeout.php on line 235″.
I wondered if you’d heard any other such comments?
22:04
Fixed in 1.3 beta 1 (just out this evening).
15:28
Thanks for this great plugin! Despite running latest version of Bad Behavior I just this morning suffered a pretty awful attack of the ‘bots, and by installing your plugin (in between 500 server errors caused by bot overload!) I was able to STOP the attack!
I also checked my comment forms to make sure they weren’t affected, since I’m paranoid and depend on them for my living. They weren’t.
GREAT JOB!
15:21
Any way to display a custom message for readers who are a little disoriented when the comment form is no longer in view? I wanted to provide a few links for readers to check out if the discussion was closed.
09:50
I just installed your plugin on my blog, but when I try to leave a comment on a closed post (comment form still appears) I get this error message:
Comments on this post are now closed.
Warning: Cannot modify header information – headers already sent by (output started at /www/htdocs/w005d252/wordpress/wp-includes/l10n.php:35) in /www/htdocs/w005d252/wordpress/wp-includes/functions.php on line 1219
I’m using WP 2.1.2 with PHP 4.4.4, any help?
10:41
Are you using the latest version (1.3 beta 1)?
11:26
I downloaded the 1.3 beta 1 zip file, but in the plugin control panel it says “1.3-alpha 2″.
15:05
I see the same thing in the plugin control panel but all is OK in the Option section.
BTW: thanks James, it works like a dream on my 2.0.7 blog .
Cheers
Brian
09:56
I downloaded CT a few days ago and it didn’t work, however I downloaded it again and it is working now! Thanks so much! This is a very helpful plugin!!!
00:46
It looks really good but I just can’t get it to work with WP 2.1.2. Is it really compatible with this version?
Granted, I’m blind as a bat and can’t code myself out of a sleepingbag… but I just can’t get it to work.
SF
22:27
Can you be a bit more specific?
12:04
i installed, changed no settings, blog
12:18
most of my previous post disapeared
??:
blog less than 1 week old, all comments closed, i changed no settings in options
Apache version 1.3.37 (Unix)
WP 2.1.3
PHP 5.1.6
MySQL 5.0.27-standard-log
Bad Behavior 2.0.1.0
any clues?
12:23
sorry i forgot
Comment Timeout 1.3-beta 2
05:16
I’ve loaded up the plugin and it seems to be working fine. Thank you. Is there an easy way of customising the message left on posts closed for comment? It currently reads “Sorry, the comment form is closed at this time.” I would like to expand upon this. ( I looked at editing the php file but couldn’t work out where this message is coded. )
10:14
The message is coded into your theme — usually either in a file called comments.php or comments-popup.php or something similar.
02:18
Nice One… thanks for the helpful plugin. Only had my blog for 4 months and already getting spam getting through Akismet. Cheers, Dave.
22:28
Thanks James – I found the comments php file and have customised my message. My spam has also reduced to a trickle since using the plug in. Yippee!
23:37
Super plugin!!! Worked like a charm. You are a life(blog)saver!
16:18
This is AMAZING. It’s cut my spam to almost NOTHING. Thank you SO MUCH.
14:53
lovely plugin. thanks very much!
10:40
thanks for the plugin, a very usefull solution.
21:32
thanks. it s cool…