Last updated November 7, 2013. Created on January 16, 2008.
Edited by davidneedham, kiamlaluno, BettyJJ, arhip. Log in to edit this page.

Custom filter is a module that allows you to create your own filters based on regular expressions. When you need some input filter that is not available from, and you don't want to write your own module, you can create your own filter with this module. What you need is regular expressions, and optionally PHP programming ability.

How it works

Custom Filter module provides filters to be used in Input Formats. A filter is a collection of one or more replacement rules. A replacement rule is a find-replace mechanism that has two main parts: Pattern to tell Drupal about the pattern to be found, and replacement text to tell what text to be used as replacement. The replacement text can be a plain text or a PHP Code.

There is a change in terminology used in Custom Filter 6.x:

  • Filter was called Filter Set.
  • Replacement Rule was called Filter.

The reason behind this change is for consistency with Drupal terminology.

Getting started

  • To install this module, simply extract this module into module directory in your drupal installation (e.g. sites/all/module/customfilter).
  • Enable this module from module administration.
  • This module is available in input formats (/admin/settings/filters) under the site configuration menu (6.x-1.x-dev). This menu path might be changed in the future version.
  • Set the permissions used from this module for the roles you want to be able to create filters with this module.

Looking for support? Visit the forums, or join #drupal-support in IRC.


MaximusOfLondon’s picture

When module is enabled on D7.34 it gives warnings:

Notice: Undefined index: caption in theme_table() (line 1790 of /Library/WebServer/Documents/drupalsite/includes/
Notice: Undefined index: colgroups in theme_table() (line 1791 of /Library/WebServer/Documents/drupalsite/includes/
Notice: Undefined index: sticky in theme_table() (line 1792 of /Library/WebServer/Documents/drupalsite/includes/
Notice: Undefined index: empty in theme_table() (line 1793 of /Library/WebServer/Documents/drupalsite/includes/

Please fix that by replacing theme_table($args) with theme('table', $args) in line 1429