Plugin: Obfuscate E-mail

This plugin has been updated! Comments to this post are now closed. For the latest download, documentation, and link for posting new comments related to this plugin, visit the plugin’s new homepage at:
coffee2code.com/wp-plugins/obfuscate-email
Name:
Obfuscate E-mail
Author:
Scott Reilly
Version:
0.9
Last updated:
24 March 2005
Description:

Obfuscate e-mail addresses in text and links via random hex and ASCII code substitution while retaining the appearance and functionality of hyperlinks.

Notes:

Example (of full obfuscation):

<a href="mailto:person@example.com">person@example.com</a>

Would be translated into something like this:
<a href="mailto:&#112;&#101;&#114;&#115;&#x6F;&#110;&#x40;&#101;&#x78;&#x61;&#x6D;&#112;&#x6C;&#101;&#x2E;&#x63;om">&#112;&#x65;&#x72;&#x73;&#111;&#110;&#64;&#x65;&#x78;&#x61;&#109;&#x70;&#108;&#x65;&#x2E;&#99;om</a>

However, in your browser it would appear to you as it does prior to obfuscation, and the link for the e-mail would still work. Theorectically, however, spammers would have a somewhat more difficult time harvesting the e-mails you display or link to in your posts.

Installation:
  1. Download the file obfuscate-email.zip and unzip it into your /wp-content/plugins/ directory.
    -OR-
    Copy and paste the the code ( obfuscate-email.phps ) into a file called obfuscate-email.php, and put that file into your /wp-content/plugins/ directory. Please ensure you do not introduce any spaces or other characters before the <?php or after the ?>
  2. Optional: Change configuration options in the file to your liking. In-code comments should help you there.
  3. Activate the plugin from your WordPress admin ‘Plugins’ page.
Functions:

function c2c_obfuscate_email( $text, $encode_everything = 1 )

  • $text : Text to be scanned for e-mail obfuscation
  • $encode_everything: optional; if 1 then full obfuscation (as seen in the Notes section) will occur. If set to 0, then only very minimal obfuscation occurs, i.e. “@” gets replaced with &#064; and “.” gets replaced with &#046;
Tips & Examples:

(See notes section above)

Release Log:
  • 24 Mar 2005 : v0.9 — Released to the public
Copyright & Disclaimer:

Copyright (c) 2005 by Scott Reilly (aka coffee2code)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Acknowledgements:
N/A

18 Responses to “Plugin: Obfuscate E-mail”

  1. This plugin is exactly what I have been looking for. No more hand obfusication or whatever that word is.

  2. [...] « Skype 1.2 is Final Obfuscate E-mail The Obfuscate E-mail plugin for WordPress has been activated here. I no longe [...]

  3. Awesome plugin! So glad someone finally made one :)

  4. Works great, thanks! I’m tiring of avoiding the bots by using the [AT SIGN] and [DOT] stuff.

  5. [...] Testing Obfuscate Email WP Plugin
    April 24th, 2005

    Let’s see if the Obfuscate Email plugin works. It uses HTML hex characters to hide email [...]

  6. Is it possible to use it on pages in WP ?

    TIA

  7. testing obfuscation moc.liamnull@retnug

  8. Nope. Doesn’t apply to comments where the most idiots post their e-mail addresses. Oh, well.

  9. Mads: Yes, it works on pages in WP.

    Pariah: Actually, it does apply to comments. I simply didn’t have the plugin activated on my site. It is now, so feel free to test again.

  10. I am not sure what is happening, but I cannot get the plugin to work.

    Look at giveayear.com/about/

    I am using WP 2.0. Plugin is activated

  11. This looks great. Let’s test ‘er out.

    moc.niamodnull@dcba
    E-mail address

  12. [...] Uploaded the Obfuscate E-mail plugin, which makes it almost impossible for bots to grab our email addresses and leaves them human readable and with working mailto: links. [...]

  13. THEMEDIA replied on

    Simpler Solution:

    Just copy this where ever you need it

    
    $email_address = "foo@bar.com";
    $email_address = substr( chunk_split( bin2hex( " ".$email_address ), 2, ";&amp;#x" ), 3,-3);
    

  14. Unfortunately, this obfuscation scheme is easily decoded by spambots. For proof, see

    willmaster.com/possibilities/demo/RetrieveEmails.cgi

    THEMEDIA’s solution is more fool proof.

  15. It’s a wonderful plugin.

    For several reasons I have put email-addresses in the post meta (such as post_custom(‘email’)). They will be published later like

    echo post_custom(‘email’);
    echo ‘” TARGET=”_blank”>Email

    Is there any way your plugin can manage this (it does not work with 2.1.3)?

    Thanks
    Tom

  16. [...] Obfuscate E-Mail (www.coffee2code.com/archives/2005/03/24/plugin-obfuscate-e-mail/) 0.9 [...]

  17. [...] Obfuscate E-mail plugin for WordPress has been activated here. I no longer need to manually encode an email address I enter here (usually [...]

  18. [...] unkenntlich zu machen. Nachdem ich dann einige Plugins wie bspw. EmailShroud, Transpose Email und Obfuscate-Email ausprobiert hatte und mit mit allen nicht ganz so zufrieden war, bin ich vor ein paar Tagen durch [...]