Oct 12 2011

Bad Word Blocker Extension for BlogEngine 2.5

Category: BlogEngineBrian Legg @ 15:26

After writing the AdSense widget and extension I decided to try writing another one that I've seen requested on a number of blogs/forums. This is simply a word replacing extension which is most likely usefull for replacing curse words in user comments. The extension is just a list of words which must be replaced and words to replace them with. You may add, edit, or remove them at any time. I could also see this being usefull for other things as well such as adding your own comment markup or whatever else you can think of that you would like to replace in the comments text.

I also wanted to try writing my extension to work with the new BlogEngine 2.5 features. So, the settings for the BadWordBlocker are unique to each blog instance it's configured/enabled for. There are also 187 predefined curse words and replacements initially loaded to hopefully save you some time. If you don't like the initial list you may edit or remove them as needed. I gathered the list of dirty words from here.

The BadWordBlocker Extension

Setting up and installing the BadWordBlocker extension is easy. Just follow these simple steps:

  • Extract the .zip to your computer
  • Copy the BadWordBlocker.cs file to your Extensions directory in your blog. For me this was in brianlegg.com/wwwRoot/App_Code/Extensions
  • Navigate to your Admin dashboard and go to the Extensions tab
  • You should see a new extension named BadWordBlocker
  • Select the extension from the list on the right

  • Enter combinations of words you want to replace and what you want to replace them with
  • Press Add
  • Press Remove to remove any you don't like
  • Press Edit to change ones that already exist

You should have a view similar to the following:

Enjoy the extension!

BadWordBlocker.zip (2.38 kb)

Tags: ,

Comments (4) -

1.
Mark Falto Mark Falto United States says:

I cant believe I clicked your "dirty words" link just to go through the entire list and giggle.  hehe

http://www.markfalto.com/blog/

2.
Dave Dave United States says:

Can you update it to include the recent comments widget?  tia

3.
Brian Legg Brian Legg United States says:

Dave - I'm not entirely sure what you're referring to. Post a link or some more details and I'll look into it. Thanks for posting.

4.
Alex Alex United States says:

The Bad Word Blocker Extension tool is really very helpful. Previously I had a TV episode blog with comments on and some guys used to add cheap comments on it. And it was very time consuming to delete each comment. This tool will be very helpful to filter such comments.
Alex http://www.daily1game.com/card-board-games/

Pingbacks and trackbacks (1)+

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading