Drupal - Encoding Email Addresses to Deter Spam-bots

Posted January 12th @ 3:15 pm  |  Filed in: Drupal    

While working on my latest Drupal project, I really wanted an easy, brainless way for users to create clickable “mailto:” links that gave pesky spam-bots a hard time.

Turns out, the Bbcode module does just the trick. Even if you don’t normally use it, you can add this input filter to your standard HTML filters, and it will work. The first step is to download and install the module.

Next up, enable the module, and add it to your input filters (located at /admin/settings/filters):

input-filters.png

As you can see,  you don’t even need to assign it any roles. However, the Filtered HTML and Full HTML filters can use it, just set them up like so:

Input Filters

Next, go in and and configure the Bbcode module to encode email addresses:

bbcode-email.png

Now, to use it - just use the standard bbcode to encode any email address:

[email]someone@domain.com[/email]

And when the page is rendered, the underlying HTML will all be JavaScript gobbly-gook, but to the end user, it will be a normal link.

No Comments Yet

You can be the first to comment!

Leave a comment

OpenID Login

Standard Login

Options:

Size

Colors