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
- Download the zip file and expand it.
- Upload the contents of the 'plugins' directory in to the 'plugins' directory of you MT installation (usually /cgi-bin/mt/plugins/)
- 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
(Blog Janitor for Personal Use)
Downloads: 728
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.


Comments (33)
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?
Posted by TJ | February 27, 2007 2:34 PM
Posted on February 27, 2007 14:34
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.
Posted by Gary | March 2, 2007 11:23 PM
Posted on March 2, 2007 23:23
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.
Posted by Mark Carey
|
March 3, 2007 7:11 AM
Posted on March 3, 2007 07:11
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. ?
Posted by Gary | March 17, 2007 1:45 AM
Posted on March 17, 2007 01:45
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.
Posted by Mark Carey
|
March 17, 2007 4:46 PM
Posted on March 17, 2007 16:46
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.
Posted by Kelly | April 8, 2007 2:24 AM
Posted on April 8, 2007 02:24
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!!!
Posted by Kelly | April 8, 2007 2:26 AM
Posted on April 8, 2007 02:26
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.
Posted by Mark Carey
|
April 10, 2007 7:53 AM
Posted on April 10, 2007 07:53
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.
Posted by Kelly | April 15, 2007 8:52 PM
Posted on April 15, 2007 20:52
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.
Posted by Mark Carey
|
April 16, 2007 12:10 PM
Posted on April 16, 2007 12:10
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!
Posted by Kelly
|
April 16, 2007 4:20 PM
Posted on April 16, 2007 16:20
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?
Posted by Andy
|
May 30, 2007 2:22 PM
Posted on May 30, 2007 14:22
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.
Posted by Mark Carey
|
May 31, 2007 1:01 PM
Posted on May 31, 2007 13:01
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?
Posted by JeffPff | August 10, 2007 11:15 AM
Posted on August 10, 2007 11:15
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.
Posted by JeffPff | August 15, 2007 4:56 PM
Posted on August 15, 2007 16:56
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.
Posted by dazla
|
August 21, 2007 9:44 PM
Posted on August 21, 2007 21:44
dazla, I haven't tested Blog Janitor on MT4 yet, and it probably needs some minor updates. Stay tuned.
Posted by Mark Carey
|
August 22, 2007 12:35 PM
Posted on August 22, 2007 12:35
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:
Posted by Drina | September 2, 2007 10:16 AM
Posted on September 2, 2007 10:16
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.
Posted by DGJ
|
September 3, 2007 12:50 AM
Posted on September 3, 2007 00:50
Still staying tuned... I'd still love to hear whether this plugin works with MT4.
Posted by DGJ
|
October 13, 2007 5:15 PM
Posted on October 13, 2007 17:15
Blog Janitor! I've got a spam epidemic on my MT4 site... need. help. badly.
Posted by jtyler
|
October 16, 2007 11:03 PM
Posted on October 16, 2007 23:03
Please also keep me updated on the progress of this on MT4, thanks!
Posted by Erik | November 6, 2007 9:53 PM
Posted on November 6, 2007 21:53
I am also looking forward to it. I haven't tried it with MT4 yet but this was a necessary plugin before I upgraded.
Posted by rm_blogger
|
November 21, 2007 5:13 AM
Posted on November 21, 2007 05:13
Okay, done. ;)
The download link above is now version 1.1, which works with both MT3.3x and MT4. Same features.
Posted by Mark Carey
|
November 21, 2007 9:06 AM
Posted on November 21, 2007 09:06
Thanks... I'm trying it now.
Posted by Dennis G. Jerz | December 23, 2007 12:21 AM
Posted on December 23, 2007 00:21
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/
Posted by Teller
|
January 11, 2008 6:50 AM
Posted on January 11, 2008 06:50
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?
Posted by gleek | January 14, 2008 9:27 PM
Posted on January 14, 2008 21:27
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...
Posted by grettir
|
February 2, 2008 3:51 AM
Posted on February 2, 2008 03:51
I have is whether the notification email
Posted by matt | March 7, 2008 8:34 PM
Posted on March 7, 2008 20:34
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.
Posted by rugs | July 5, 2008 9:57 AM
Posted on July 5, 2008 09:57
Hi,
I'm haveing a problem with Blog Janitor.
I've put BlogJanitor on a blog I manage for my boss. He has over 2000 entries. It is running fine, but the issue is; it is also closing (not allowing to display) any comments that were left by users. (I want it to only close the form).
We do have specialized templates - so maybe I have a hook labeled wrong somewhere?
I have no idea how to troubleshoot this.
Help!
JD
Posted by jdshipengrover
|
October 24, 2008 10:22 AM
Posted on October 24, 2008 10:22
thanks
Posted by road blocker mantar bariyer | February 28, 2009 3:24 AM
Posted on February 28, 2009 03:24
Hi Mark,
Love your plugin! and am wondering if there’s a way to increase the number of posts per hour that it cleans.
We just imported 27,000 posts to a new server with an upgraded version of MT, and want to go live ASAP, except we need to turn off comments that are more than two weeks old.
After that, we could go back to the 100 per hour—and if I need to buy the support or the profession version, we’re glad to comply.
Thanks
Posted by CTN | September 9, 2009 11:17 PM
Posted on September 9, 2009 23:17