Fast Profanity Filter Plugin With jQuery

Fast Profanity Filter Plugin For jQuery
Fast Profanity Filter Plugin For jQuery

Fast Profanity Filter Plugin With jQuery A client-side and multilingual profanity filter helps to create a more positive and welcoming atmosphere on your website.

This jQuery profanity filter plugin censors bad language on the webpage and replaces bad words (offensive words, swear or cuss words) with custom characters you specify. This can be helpful in creating a more family-friendly or professional environment on your website.

How to use it:

1. Download and include the jQuery profanityFilter in your project.

<script src="/path/to/cdn/jquery.slim.min.js"></script>
<script src="/path/to/jquery.profanityfilter.min.js"></script>

2. Call the function on the target text container and load the preset swear words list.

  externalSwears: 'swearWords.json',

3. This plugin currently supports 8 languages:

  • de.json
  • en.json
  • es.json
  • fr.json
  • it.json
  • nl.json
  • pt.json
  • ru.json
  externalSwears: './localResources/de.json',

4. You can also define your own swearword list in a JS array as follows:

  customSwears: ['ass', 'shit'],

5. By default the plugin will replace all bad words defined in the swearword list with an asterisk (*). You can use the replaceWith option to customize the characters used to replace bad words in the text.

  replaceWith: ['jquery', 'script'],

6. Highlight all bad words in the text instead of filtering.

  filter: false,
  profaneText: function (data) {
    data.forEach(function (element, index) {
      var str = '<span class="highlight">' + element + '</span>';
      $('#example').html($("#example").html().replace(element, str));
.highlight {
  color: red;
  font-weight: bold;
  padding: .2em;

Live Demo

See the Pen Fast Profanity Filter Plugin With jQuery by Teguh Sigit (@teguhsigit) on CodePen.

File Info

File Name :
Size :
Site Download :
Official Website:
Previous Post Next Post