Over the last couple of months I have begun being bombarded with spam emails for assorted products ranging from weight loss programmes to medical services - its become a real pain!

The cause of all this is spambots harvesting the contact email addresses on my site. Now whilst I want visitors and potential customers to be able to easily contact me I dont want spambots to be able to harvest my email addresses for their dodgy needs.

So whats the answer?

Having looked at a number of other sites, the solution (they adopted) appears to be a technique of email obscuring (obfuscation - nice word!).

The technique is essentially to "hide" email addresses (mailto links) where Javascript is turned off and replace said addresses with a Javascript click link/event.

Drupal module 'SpamSpan' to the rescue

What I needed was a nice easy pre-written filter based module that could identify mailto links and apply the necessary logic to obsure them as required.

That's where the contrib module SpamSpan comes in. It allows you to apply a filter to existing text formats which will recognise mailto links and convert them to the appropriate obscurred format. 

What this means that the link is still visible (and readable by screen-readers) but not clickable without Javascript enabled, and with an obscurred link address which is (hopefully!) meaningless to spambots.

So maybe the emails will now stop...