Anti-Email Spam (email bot obsfucator)

This is a very simple plugin that attempts to hide email addresses from ‘bots (computer email harvesting programs). Why would you want to do this? Because these nasty little harvesting programs are used by equally nasty little spammers. They scour websites looking for email addresses, which are then added to their spam list.

All the plugin does is replace any email addresses in your posts and pages with an obfuscated version. Two types of obfuscation are available:

Entity encoding – this encodes the email address as HTML entities, making it invisible to most harvesting software

JavaScript encoding – the email is encoded as a short piece of inline JavaScript code

So which is best for you? Well, it depends. I’ve seen reports of smart spammers decoding entities and successfully extracting email addresses. However, this method will work on all browsers, regardless of JavaScript. On the other hand, spammers have not yet, as far as I’m aware, implemented JavaScript in their programs, so the JavaScript version should be ‘untouchable’. This is at the expense of emails being invisible to non-JavaScript enabled browsers.

The choice is yours.

After obsfucation the email address is wrapped in a mailto:, allowing viewers easy email access (while still stopping the ‘bots).

Nice one!
I’ve never heard ’bout your plugins before. It was a coincidence to get here through a link on some page.
I just want to say: all of your plugins are very usefull!
Keep on the good work … I’ve added you to del.icio.us

I am using your anti-email-spam plugin. I found out that, when I choose "Entity encoding", there will be a link created, but the "mailto" is missing – instead, there will be a link like "yourblog/abc@def.ghi".

Mmm iv tryed used this plugin for my custom form, iv added this line to script
add_filter (‘the_content’, ‘anti_email_spam’);
add_filter (‘c2c_get_custom’, ‘anti_email_spam’);
but strange plugin not work for any, without my line and with my line
my wp 2.2.3 and all emails posted without any link and mailto, only like text – example – test@test.com
plugin doe’t not work for text only? need added mailto?

[…] Anti-Email Spam (email bot obsfucator) | Urban GiraffeThe basics of spam, "phishing" and other e-mail pests, how they got your address in the first place â€” and what to do now that you’re inundated. â€¦ […]

This plugin was breaking for me with wordpress 2.3.4 because it was running before the default wordpress auto-formatting filters. Then the wordpress filters would alter the javascript code making it generate javascript errors.

Changing the anti_email_spam filter to run last fixed it for me

Just add the 99 in the filter code to get it to run after all other filters.
add_filter ('the_content', 'anti_email_spam',99);

Nice plugin. Are you taking feature requests? 🙂
I noticed that the plugin does not look at the href attribute. It seems that links such as[a href="mailto:user@domain.com"]user name[/a]
would be just as important to consider when trying to prevent harvesters.

John, would you mind explaining how I have to code my e-mail so your plugin will recognize it? I’ve only been working with WordPress since December and haven’t launched my private blog yet (want to get it safe first). Maybe there’s something I’m missing?

I understand that I’m not supposed to write my e-mail like this:write me

But when I leave out the mailto-part, my e-mail address gets attached to the path of the specific post that contains the e-mail address. Like this: http://my.domain.net/year/month/day/post-slug/me@mail.net

John, never mind, I just figured it out: the e-mail address needs to be written in clear text, not as a link. In other words: just type your e-mail address in the visual panel of the WP editor and don’t freak out. Once your posting/page is published, go and check the source code of the page – you can just search for the @-sign. It won’t be there.

I mention this here in detail for other newbies like me — maybe you could add this piece of info to your description/instructions, John? Not everybody who simply USES blogs knows all the intricate workings of all the used programming languages. I looked around online and found quite a few people who things a plugin doesn’t work if you don’t see the result immediately inside the WP editor!

Oh, one last thing: you have above this comment box a list of XHTML tags which I’m supposed to be able to use in here, when writing a comment. However, it doesn’t work! Nothing get’s formatted correctly. And, as some other folks before me mentioned: the code-tags don’t turn the text into code; they highlight it, but that’s all, the code entered is still interpreted. Maybe you’d like to look into that? Hope I could help!

Hi John-
I’m also seeing this issue (periods at ends of sentences are included in the constructed mailto:). As far as I can tell, it has to do with the last period in your regexp: ('/([> ])[A-Z0-9._-]+@[A-Z0-9][A-Z0-9.-]{0,61}[A-Z0-9]\.[A-Z.]{2,6}/i. If you remove the dot after the Z, the period doesn’t get matched into the email address that is encoded. I’m not entirely sure why that dot is in the character class in the first place. Was there a specific case I’m missing? Thanks!

I wanted to use this plugin on WP 3.2.1.
I installed it and wanted to try, but it seems not to convert xx@xx.com text from a page to an mailto : xx@xx.com :/
What I did was- install plugin, edit page (removing mailto), update page, check for result…

Is this a compatibility issue with newest WP or am I doing something wrong ? :/