« Add Category Plugin - Add Multiple Entries to a Category | Main | Spam Firewall v1.2 - Updated Rules and Bug Fix »

Close Comments with Blog Janitor

Blog Janitor is a plugin for Movable Type that preforms various clean-up tasks. In version 1.0, Blog Janitor can perform the following tasks:

  • Close comments on old entries.
  • Delete duplicate comments and trackbacks

Blog Janitor does his work automatically, you don't need to edit your templates. Just tell Blog Janitor the tasks you want him to perform (by adjusting the plugin settings), and he will go to work periodically (using the scheduled tasks feature of MT 3.3+).

Here are some details on his current skills:

Close Comments and Trackbacks on Old Entries

One technique for reducing blog spam is to close comments (disable commenting) and trackbacks on entries that are older than a certain number of days. This can be a tedious process to do manually, if you remember to do it. Blog Janitor can take care of this job for you. Simply enable Close Comments in the plugin settings for a blog, and tell Blog Janitor the number of days he should wait before closing comments on an entry. That's all you have to do, Blog Janitor will routinely check for old entries and close comments on them for you.

Delete Duplicate Comments and Trackbacks

Duplicate comments and trackbacks can happen in a number of ways. For example, a commenter may hit the submit button twice, thinking that the comment did not get posted the first time. Another common occurence is duplicate junk comments and trackbacks -- since spammer often post identical spam messages, your Junk folders may be full of duplicates. Blog Janitor is skilled a scanning your recent comments and trackbacks for duplicates. If you give him the order (by enabling duplicate checking in plugin Settings), he look for recent duplicates and delete them. Just tell him how many recent items to scan, and he will go to work every hour looking for recent duplicates. (Note: there is no "undo" when Blog Janitor deletes items, but he does leave a message in the Activity Log notifying you of which items he has deleted).

Settings

The Settings is where you give Blog Janitor his orders. Go to the blog you want, then choose Settings, then the Plugins tab, and then click on Setting for Blog Janitor. The settings look like this:

Requirements

  • MT 3.3x

Instructions

  1. Download the zip file and expand it.
  2. Upload the contents of the 'plugins' directory in to the 'plugins' directory of you MT installation (usually /cgi-bin/mt/plugins/)
  3. Adjust the settings as described above

Notes:

  • If you have a large number if entries in your blog, Blog Janitor will not close comments on every old entry the first time he goes to work. He gets tired if he tries to close comments on too many entries at a time, and his union contract states that he doesn't have to close comments on more than 100 entries each hour. (Okay, the real reason is to save your MT from excess load that might slow things down) Since Blog Janitor works on up to 100 entries each hour, it may take some time before he gets 'caught up'. For example, if you have 2400 entries on your blog, it will take about 24 hours for Blog Janitor to go through all the old entries and close comments and trackbacks.
  • Blog Janitor punches his time clock when he starts and finishes a task. For each task, he posts a message to the Activity Log that explains what task was completed, and how many seconds it took him to complete. If you are concerned about system load, keep an eye on the Log to see how hard he is working.

Get Blog Janitor

Blog Janitor is free for personal use:

Download Now

Membership required, please sign-in or register:

Commercial Use: $97

If you buy a commercial license, you will get priority for future features, and an advanced version of Blog Janitor that enables you to give Blog Janitor orders on a system-wide basis (so you can adjust the settings in once place for all blogs on the system).

As always, comments and suggestions are welcome - please reply to this entry.

Rate this entry:

  • Currently 3/5
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 3/5 (5 votes cast). Powered by the Ajax Rating plugin.

TrackBack

TrackBack URL for this entry:

Listed below are links to weblogs that reference Close Comments with Blog Janitor:

» BlogJanitor from Movable Type
Mark Carey сегодня представил свой новый плагин для Movable Type – BlogJanitor. Плагин предназначен для автоматического закрытия комментариев и устан... [Read More]

» MT Hacks Transformer 2ĤȤ¾ from 饪
MT Hacks Ĥץ饰꡼Ƥ褦ʤΤǾҲ𤷤ޤ [Read More]

» links for 2007-04-13 from Slobokan's Site O' Schtuff
Solid Wall of Code: AutoBan One of the most awesome plugins for Movable Type (tags: movabletype blog blogging plugin) Blog Janitor - Close Comments and Delete Duplicates - MT (Movable Type) Hacks Another great "must-have" plugin for Movable Type... [Read More]

» Best Movable Type plugins from Wingie's Cradle
Movable Type has been my blogging CMS platform since the beginning of the blog. I have first started to host it back in year 2002, and it was running off my home connection. Due to the traffic, I had to... [Read More]

» About from The Entertainment Shack
About Me My name is Erik, and I am a senior at the University of Wisconsin-Madison and am double-majoring in Computer Science and Technical Theatre. Some of my interests would include Freestyle Skiing, Computers and Networking, Entertainment Lighting,... [Read More]

» CM stresses modern education - from food home india modern passion regional
Designing is another passion of Hussain. “I designed a wooden doll, that of a man carrying a briefcase and wearing [Read More]

» big fine tiits from
big fine tiits [Read More]

» Teen Lesban from
Teen Lesban [Read More]

» Teen Teen Pron from
Teen Teen Pron [Read More]

» Song Beautiful from
Song Beautiful [Read More]

» resveratrol from resveratrol
The package comes with a couple different products, each one targeted for specific skin care functions. The Revitol Anti Wrinkle Complex Treatment consists of these touted ingredients (which you find in a VERY high end line of products that is double t... [Read More]

» crohns disease from crohns disease
professionals, is dedicated to improving patient care through education and research. A neurologist is a doctor with specialized training in diagnosing, treating and managing disorders of the brain and nervous system such as stroke, Alzheimers disease,... [Read More]

Comments (30)

TJ:

Nice to see a great idea revisited for MT 3+ users. I have BlogJanitor installed but have not noticed any entries in the activity log for closing comments. Is there a way to verify Blog Janitor is working correctly?

Gary:

I like the plugin, but have a feature request: would it be possible to have an exempt feature for specific entries? I'm using an entry as my contact form versus formmail or email link (both of which, no matter how secure a formmail script i've used I get harvested). Thinking the comment feature is a safer (x email spam) way for a contact feature, but Blog Janitor will at some point keep closing that entry.

Interesting suggestion, Gary. I will have that some thought, as implementing that might be tricky.

FYI, another option for a contact form is my Entry Post plugin. In additon to letting visitors post entries, you can also configure it as a contact form, and it works great. It never publishes email address. See example here.

Gary:

Thanks, Mark. Entry Post plugin looks like it would work well for the contact form idea + have other value.

I looked through the description and the only question I have is whether the notification email is buried in the form via a hidden input field, of it's somewhere off-page in the scripts. ?

Gary,

The notification email is never hidden in the form -- never "on-page". You can set a notification email address in the plugin settings, OR specify an author_id in a hidden form field, and the email will get sent to the email address of that author (as set in their MT user profile). The latter option is useful for multi-author blogs, and you want visitors to contact a specific author.

Kelly:

Mark, this is a great plugin! I'm just starting to use it and have run into an issue. The following error comes up about 10 times in each of my 15-minutely cron logs.

Use of uninitialized value in string eq at (path to MT)/plugins/BlogJanitor/BlogJanitor.pl line 82.

Any idea what could be causing this? My activity log says that BJ is checking duplicates just fine, but the duplicate check/deletion times correspond closely to the times of my cron outputs.

Also, BJ has left many of my old entries' comments and trackbacks open even though I've set it to close them 45 days after publication. Is there any way for me to force BJ to close comments, or to otherwise check that it's doing this appropriately/correctly?

Many thanks for your great work on this essential plugin.

Forgot to add - I only have 200 entries on my blog, so I don't think that the janitor is getting tired from closing so many entries at once. :-) Thanks!!!

Hi Kelly,

Regarding the first issee (uninitialized value), that sounds like a warning, and not an error. Meaning, its probably still working as desired. That said, I would like to avoid such warnings. Question: how many trackbacks do you have in the blog(s) in question?

Regarding comments are trackbacks not be closed on "some" of your older entries, that does seem odd. Is there any pattern to what gets closed at what doesn't? For example, are they in a certain date-range, or does it seem random? I tried about 25 entries from your site, from 2003, 2004, and 2005, and the comments are closed on all of them.

Hi Mark - thanks for your response; sorry to be tardy in my reply.

It now seems like the closure of comments and trackbacks on old entries is working as planned - I tried numerous entries from as recently as February 2007 and they're closed. Yay! I initially thought they weren't closing because I kept getting trackback spam on 2006 entries which should have been closed.

The site has 5 valid trackbacks. I last received trackback spam (which wasn't deleted by BJ as it wasn't a duplicate) on an entry from 2005 which says that it is still accepting comments and trackbacks, sigh. Maybe I was incorrect in my above assumption that all old entries have been closed.

My activity log says that BJ is doing lots of duplicate checking, and deleting a fair amount of my trackback spam, but I have not seen it close comments or trackbacks since it was first installed. Even disabling and re-enabling the comment & TB closure feature didn't cause it to go out and close the old stuff like that entry above.

What else can I do to help you figure out this cron-generated warning? The cron reports are still coming regularly, all with the same warning about the string eq.

Hi Kelly,

I should have been more specific in my first question: how many trackbacks do you have total, including junk trackbacks?

I just sent a test trackback to the entry you linked -- did it go through?

I have another question: prior to using Blog Janitor, did you manually turn off comments on any entries? If so, is there any chance that you might have turned off comments but left trackbacks enabled for some/all of those cases? If so, you may have run into a rare exception in the way Blog Janitor works. When Blog Janitor looks for entries to close, he only looks at entries that have comments enabled. As such, if there are any entries that already have closed comments but enabled trackbacks (a rare case, but possible), then trackbacks on those entries wouldn't get closed.

Kelly [TypeKey Profile Page]:

Hi Mark,

At the moment I have 5 valid, 1 unpublished (yours from earlier today), and 47 junk trackbacks. I cleared the junk out a couple of weeks ago before installing Blog Janitor.

I think my older-entry-open-trackback problem does partially come from having comments already closed but Trackbacks left open. I've tried in the past to use the MT-close "plugin" to close comments and trackbacks en masse manually. However my MT says that the entry in question (link in my last response) has both comments and trackbacks open even though I don't see a comment box on the entry's page. Puzzling.

The warning in my cron logs is (hopefully!) a separate issue; can we do anything about that?

Many thanks for your time!

Andy [TypeKey Profile Page]:

I'm on a windows server so I can't do cron jobs - is there a way that I could start it manually every once in a while?

Andy, you don't need cron jobs to use this plugin.

Blog Janitor gets triggers with Movable Type's "scheduled tasks". A cron job is one way to trigger scheduled tasks, but there are two others:

1) When your MT received a JUNK comment or trackback, it will trigger scheduled task automatically.

2) When an "Activity Feed" is requested,it will trigger scheduled task automatically.

The second option can be used to manually activate Blog Janitor. For example, if you are on the "Comments" screen in MT, click on the "Comments Feed" link near the top right. This will display an "activity feed", and behind the scenes, Blog Janitor will get to work. However if you get JUNK comments regularly, you won't even need to trigger things manually.

JeffPff:

Very useful program. But for some reason blog janitor stopped closing comments after ~12 hrs, and I noticed only those entries which were created this year have comments closed. All entries as old as 4 years prior still have comments enabled.

I upgraded to movabletype 3.34(i think) at the start of this year. Is it possible blog janitor simply doesn't target entries created in older movable type versions?

JeffPff:

Oops, disregard my last post. My mistake, the comments from previous years were closed after all! Still, BlogJanitor logged only 1/4 of the entries with comments successfully closed, out of my total number of entries, but perhaps it purposely only publicized the closing of those which had active discussions going? Anyway, you can remove this post and my previous post.


dazla [TypeKey Profile Page]:

Has anyone tested this plugin with MT4 yet? I've tried it and it doesn't seem to be turning off old comments. I was wondering if it was just a problem with my install or MT4 in general.

dazla, I haven't tested Blog Janitor on MT4 yet, and it probably needs some minor updates. Stay tuned.

Drina:

I have TJ's problem. I installed Blogjanitor yesterday but nothing has happened... It's enabled, but no entry comments (that I can tell) have been closed, and nothing shows up in the activity log. :confused:

DGJ [TypeKey Profile Page]:

Sounds like a great plugin, and well-designed.

Does BlogJanitor rebuild the entries after closing comments, so that the comments form doesn't appear?

And does BlogJanitor work with MT4?

I'm not a commercial user -- I'm a college teacher, with hundreds of student blogs. Is there an educator discount for the advanced license? I'd like to be able to manage old student blogs in batches.

DGJ [TypeKey Profile Page]:

Still staying tuned... I'd still love to hear whether this plugin works with MT4.

jtyler [TypeKey Profile Page]:

Blog Janitor! I've got a spam epidemic on my MT4 site... need. help. badly.

Erik:

Please also keep me updated on the progress of this on MT4, thanks!

I am also looking forward to it. I haven't tried it with MT4 yet but this was a necessary plugin before I upgraded.

Okay, done. ;)

The download link above is now version 1.1, which works with both MT3.3x and MT4. Same features.

Thanks... I'm trying it now.

Teller [TypeKey Profile Page]:

Hi, bit of a problem. Recently upgraded to 4.01 and now uploaded Blog Janitor. Shows up in the list of plugins but something seems broken - no way I can open up the settings. Info = Run script "void(0)" and other links are external ones. Doing something wrong or does it really look like it's broken?

Screenshot here: http://flickr.com/photos/teller/2185360146/

hi, i also installed blogjanitor recently on MT4.01 and it's not closing comments on old posts. i've checked the activity log and it is checking for duplicate comments, though.

one thing that may be different from most people is that i migrated from an old MT3 system on another server. so, i had a clean install with no entries, installed the plugin, then imported in all the entries (3 years worth, over 900 entries). this was a few days ago. since then i have invoked blogjanitor a few times using the methods you describe above. still comments are open and functioning on old entries. any advice?

Just a few feature requests...

1. After a few weeks, the Activity Log is bursting with "Blog Janitor has finished checking duplicates (0 seconds)" entries. It would be nice to be able to set the log level so these only show up in the Activity Log when it actually does something, much like when it closes comments/trackbacks.

2. It would be really nice if Blog Janitor would tell you the title of the entries it has closed comments/trackbacks on.

For what it's worth...

matt:

I have is whether the notification email

rugs:

I often wonder if its really worth it to close comments on a blog. Reason being is that often people do find your blog quite late, and can still produce some useful comments. Sometimes they may even resurrect an old topic. Plus, it helps you to get an idea as to what entries / topics are really popular, and you can maybe produce more posts around that topic since most people probably get to your blog from a Google search and such.

Post a comment

Gift idea: Buy Seinfeld DVD box set, complete 9 seasons!