Anti-Email Spam (email bot obsfucator)

download

Download Anti Email Spam 1.3

853 bytes - WP 1.5-2.7
Updated March 7, 2009.

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 obsfucated version. Two types of obsfucation 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).

Installation

  • Download anti-email-spam.zip
  • Unzip
  • Change obsfucation, if necessary (see below)
  • Upload antiemailspam.php to /wp-content/plugins
  • Enable plugin from Plugin administration

You can find full details of installing a plugin on the plugin installation page.

Configuration

Configuration is extremely simple. You can change the type of email obsfucation by editing the antiemailspam.php file and commenting/uncommenting the appropriate line:

//$anti_callback = "anti_callback_entity";
$anti_callback = "anti_callback_js";

JavaScript obsfucation is enabled by default. To swap to entity encoding the code should look like this:

$anti_callback = "anti_callback_entity";
//$anti_callback = "anti_callback_js";

NOTE: email addresses already inside a mailto: are ignored.

40 Comments

  1. AlainS :

    Mar 2, 2007 3:21 pm | Reply

    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

  2. ziranfaze.com :

    Apr 18, 2007 9:47 am | Reply

    Is it wp2.1.3 compatible?

    After activation, all the email come after mailto automatically will be obfuscated, no need further configuration?

  3. Marco Luthe :

    Sep 12, 2007 12:53 pm | Reply

    Hi!

    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".

    So I looked for
    return $matches[1].''.antispambot ($email).'';

    and replaced it by
    return $matches[1].''.antispambot ($email).'';

    Now everything is working fine...

  4. Marco Luthe :

    Sep 12, 2007 12:57 pm | Reply

    Damn it... that comment got all mixed up -
    although I used the <code&gt-tag!

    Well, I hope you find out what I meant:
    the "mailto" is missing in the <a href...-tag.
    ;-)

  5. John( author ) :

    Sep 15, 2007 4:42 am | Reply

    Fixed

  6. alex :

    Sep 15, 2007 9:16 am | Reply

    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?

  7. Ron Green :

    Oct 17, 2007 8:30 am | Reply

    You can find full details of installing a plugin on the plugin installation page. [How to install a WordPress plugin] gets a 404.

  8. Kjell :

    Dec 14, 2007 6:58 am | Reply

    Hi there John,

    Great plugin ... hopefully won't have too many of those without javascript.

    Seen this one? http://www.alistapart.com/articles/gracefulemailobfuscation

    Caters for those who haven't got javascript turned on.

    Might be something to implement as an option in an upgrade.

  9. marcus :

    Feb 25, 2008 9:59 am | Reply

    Looks like WP 2.3.3 broke this plugin -- emails are now coming up as blank.
    Any ideas?

  10. John( author ) :

    Mar 4, 2008 2:27 pm | Reply

    Also fixed

  11. Marcel :

    Mar 12, 2008 3:28 pm | Reply

    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);

  12. John( author ) :

    Mar 17, 2008 8:41 am | Reply

    Changed

  13. jason :

    Mar 25, 2008 11:09 am | Reply

    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.

  14. Obfuscator :

    Apr 3, 2008 4:02 am | Reply

    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

    Any help would be greatly appreciated! Thanks!

  15. Obfuscator :

    Apr 3, 2008 7:38 pm | Reply

    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!

  16. Don :

    Apr 6, 2008 5:06 pm | Reply

    Hi John,
    Thanks for the great plugin.

    Is it possible to add a decision to the code such that depending on the browser javascript status, either javascript or entity encoding is used.

    Seems this would be the ideal way to address the problem, giving the maximum solution most of the time (javascript) and still providing for non-javascript browsers.

  17. Joni Solis( subscriber ) :

    Jan 4, 2009 7:11 pm | Reply

    Just want to make sure this Anti-Email Spam (email bot obsfucator) plugin works OK with the latest WordPress 2.7 version before I install it.

  18. John( author ) :

    Jan 6, 2009 5:09 am | Reply

    I haven't tried it yet, but I can't imagine any problems with WP 2.7.

  19. noon3 :

    Feb 6, 2009 12:22 pm | Reply

    Hi John.
    It seems to be broken on 2.7 release of Wordpress. I made a post should you need it.

    Kind Regards,

    • John( author ) :

      Feb 6, 2009 1:21 pm | Reply

      It's not broken. The plugin works on posts and pages, not comments

  20. Priyanka Naskar :

    Mar 9, 2009 6:24 am | Reply

    It really worked. Thanks!

  21. Edwin :

    Apr 7, 2009 6:27 am | Reply

    Hi,

    I am trying to download version 1.3 (like it says by the download icon) But instead get version 1.2. (this is mentioned in the downloaded php file)

    Anyway I need the version suitable for wp 2.7.1.

    What now ?

    • John( author ) :

      Apr 13, 2009 12:51 pm | Reply

      The plugin works in almost all versions of WP

  22. Chance :

    Apr 15, 2009 11:27 am | Reply

    It seems to be adding the period at the end of sentences to the email address. Is there a way to fix this? It looks very awkward to have a space before the period at the end of a sentence.

    • John( author ) :

      Apr 18, 2009 11:41 am | Reply

      Are you sure? No one else has reported this problem and I can't reproduce it

      • Debbie Campbell :

        Aug 6, 2009 6:05 pm | Reply

        It's doing this for me too - adding a period at the end of the email address but only when the email is at the end of a sentence. You can see it here:

        http://www.redkitecreative.com/projects/getborn/about-us/writers-guidelines/

      • David N. Blank-Edelman :

        Nov 11, 2009 12:54 pm | Reply

        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!

  23. David :

    May 1, 2009 3:08 pm | Reply

    Is there a way to apply plugin to an email in a particular custom field?

    • John( author ) :

      May 9, 2009 10:13 am | Reply

      No, it only works in posts and pages

  24. Debbie Campbell :

    Aug 6, 2009 5:53 pm | Reply

    This is great, working perfectly. Thank you!

  25. Gary :

    Sep 4, 2009 6:57 am | Reply

    Any way to get this to work inside widgets? It seems to ignore addresses as far as I can tell. Thanks.

    • John( author ) :

      Sep 9, 2009 2:46 pm | Reply

      If the widget uses the_content then yes, otherwise 'fraid not

  26. Clinton :

    Dec 13, 2009 5:58 pm | Reply

    Thank you, I am a marketing professional with a new marketing consulting business. We have built our site with WP and I have added this in as I do not want to be sibject to countless spammers!

    I added this in in less than 2 minutes edit the options in under 30 seconds and now it is live.

    THANK YOU!

    Love WordPress!

    Kind regards, Clinton.

Pings & Trackbacks

wordpresscn.com, saphod.net, cssgirl.com, technology.kencarlson.org, infotech.lakeviewchurch.org, lorelle.wordpress.com, saphod.net, wp-plugin-archive.de, rocketmonkeyrodeo.com, noone-special.com, techrecipeblog.wordpress.com, tech-recipe.co.cc, her-media.com, customweb2.com, langer.ws,

Leave a Reply


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Home | Main content | Software | Terms & Conditions | Sitemap | John Godley © 2010