December 25, 2004

Closing Comments

One measure to guard against spam is to close comments on old blog entries. This is easy enough to do.


At the bottom of your Edit Entry window is the pull-down for none, open, or closed comments. If you don't see this as pictured, click on "Customize the display of this page" link, select "Custom" and select the fields you wish displayed, including "Allow Comments".

You can also set comments to be open, closed or non-existent by default through the weblog config window, Preferences section. Under "Comment Configuration" see "Allow Comments" Default. Note that you can override this default via your selection on the individual entry.


There are several plugins that can be used to automatically close comments on old entries. See:

  1. Conversation Killer
  2. MT-CloseComments by Alan Carroll
  3. David Raynes' MT-Close


If you are using the MySQL database it is pretty easy to go in with CPANEL or a tool like CocoaMySQL for the Mac and edit the database to close comments on many entries at once.

"Comments are now closed" Message

If you do close comments, after they've been open and have accumulated a few, it helps to let your visitors know that comments are actually closed. Otherwise it can be a bit confusing; they see a link to comments, a list of comments, but no place to leave a comment.

To leave a "Comments are now closed" message that shows up when comments are closed, but not when they are open or non-existent, you can add the following code to the default MT Individual Entry Archive (assuming your comments are inline).

<MTElse> <p>Comments are now <b>closed</b> for this entry.</p><br /> </MTElse>

Put this code right above the following tags in the MT3 default Individual Entry Archive template:

</MTEntryIfCommentsOpen> </MTEntryIfAllowComments>

Has this tutorial been helpful? Please consider linking to Learning Movable Type at . Thanks!

Posted by Elise Bauer on December 25, 2004 to Comments and Trackbacks
Comments(14) | Email to a friend | Printer-friendly version


If you would like to send a trackback
please use the following URL:


Regarding your Closed Comments message...I'm so impressed that you took my constructive comment seriously enough that you addressed it so quickly & directly! And I wish I knew as much as you about code...then I wouldn't feel so daunted about switching over to MT!

For those of you who are geek-minded, Kasia has put up a perl script which closes all entries older than 2 weeks (configurable). Read more about it here.

After having several of my sites hammered with comment SPAM lately, I needed to have a way to close all of the old threads automatically. Conversation Killer fit the bill perfectly.

I am not quite ready to require TypeKey registration yet because there still seems to be some issues with some people registering.

The "comments closed" message didn�t work on my blog. I�m using version 2.661 of MT.

Do you know what the differences between the 3 plugins are? I read the descriptions and obviously, they perform the same function, but what are the differences? I installed MT-CloseComments on my system and everything's working; I'm just curious about the other two. Thanks!

Roberlan - yep, the instructions are specific to MT3. I don't use MT 2.661 anymore so haven't considered the instructions for that version. You might want to ask over at the MT Support Forums.

Katherine - sorry! I actually just go into my MySQL database and close the comments from there. I don't know the differences between the various methods. You might try asking over at the forums.

Hey, I like the idea you have about how to curb comment spam. I just wanted to share a method that I've been using and so far has worked well for me.

I have a few entries (Welcome post, test posts, etc) that pretty much hold the line up for the first 5 entries of my blog. These are the oldest entries and oddly enough, these are the ones that get spammed the most for some reason.

Because of this fact though, I've been able to have unmoderated comment posting to my site and use MTBlacklist to stop spam from appearing on my site. Those first few entries just don't lead themselves to commenting so MTBlacklist moderates those and the newer ones are let free (other moderation from MTBlacklist helps out as well of course).

Basically my older entries are set as lure for the comment spam and then once a week or so I just go in and erase all of those comments without worrying.

I will however close commenting on a lot of "middle" dated posts as per your great suggestions. Awesome site btw!

BTW, I'm using MT version 2.661, and "Comments Closed" worked for me!

Is there a way to have 'no comments allowed on this entry' if commenting has been set to 'none' on a particular entry?

Nevermind.. i figured it out. I placed a MTIfCommentsNotAllowed tag after the closing MTEntryIfAllowComments tag and added my 'Comments are not allowed on this entry' between a MTElse tag. Pretty straightforward really.

..there was a slight problm though. Although the above worked on entries that had no comments allowed, it also showed up on entries which had comments closed..

Umm, you might want to check over at the MT Forums to see if someone has a solution for this.

i've actually REALLY sorted it out!.. the code can be found here:

It's the last post.

I have found the MT 3.2 plug-in CCode to be amazingly effective at preventing comment spam. I don't have the additional TCode plug-in enabled so I can't say if it works or not but CCode is brilliant. You only have to install the plug-in and add one simple line of code to your template and you are set.

Post a comment

(Before posting a comment please see the Comments and Trackbacks Policy. Do you need help troubleshooting your weblog? Please post questions and requests for support at the MT Support Forums. Thanks!)

Remember Me?

(you may use HTML tags for style)

Email to a friend

Email this article to:

Your email address:

Message (optional):