WordPress: Email obfuscator plugin
Posted on September 29th, 2007 | by Billifer | email, plugins, spam, TextMate, WordPressWordPress I have just released the initial version of my new WordPress plugin, eMob, to automatically make it very, very difficult for spam harvesters to pick up email addresses from posts and comments from WordPress-powered blogs.
The idea comes from Allan Odgaard, the developer of my favorite editor TextMate, who has incorporated the feature into the editor but asked in a recent blog posting whether anyone had (or would) port such functionality to a WordPress plugin.
Here it is.
This is version 1.1 of the eMob plugin. It will do the following:
- Convert addresses into a version that is human readable but spambots don’t like;
- For JavaScript-enabled browsers, the plain-text address is replaced with a hyperlink that is fully clickable but also spambot-unfriendly.
- In short, neither bloggers nor readers need do anything to take advantage of the power of this plugin except install it. You want to give your email address out, like feedback {at} paxoo(.)com? Go ahead! See—I just did. (Take a look at the page source if you want to see what the plugin did to that. I merely typed it as a regular address like you would in your email program.)
The plugin is available for download at the WordPress Plugins Archive and is licensed under the GPL.
If you find this plugin useful, please consider a donation. ⌘






11 Responses to “WordPress: Email obfuscator plugin”
By Allan Odgaard on Sep 29, 2007 | Reply
Thanks a lot for the plug-in, I really like the idea of storing the ROT13-encoded text in the ID of a containing tag and then have the JS just replace the content based on the ID.
One problem though is when the email address is in the argument-part of a tag, like:
This is why I had to go with a “full” HTML parser, i.e. to have it then replace the entire
<a href="…">…</a>construct with JS.I am btw curious as to why you chose to put the human-decodable email in the info of the tag, and add an extra
span. I.e. would the following not be enough for the JS to do its magic:By Allan Odgaard on Sep 29, 2007 | Reply
I changed
@into@to not have emob work on my comment (it mangled it), so you may want to test this.Btw: editing one’s comment has the comment shown again with a) all non-ASCII (UTF-8) characters as wrong and b) all entities have been decoded to actual value.
Also c) several tags gets stripped, like
<pre>, but I assume that is more of a WordPress “security” setting.By Billifer on Sep 29, 2007 | Reply
Hi Allan,
Thanks for testing eMob. You’ve exposed many of the inferiorities that my initial hack seems to suffer. A JavaScript genius I am not.
The biggest problem seems to come from playing nicely with other plugins that automatically convert the email to a clickable link, resulting in something like
<a href="mailto:<abbr id="...Before this plugin can be used, it’s apparent that I must fix this issue immediately.
As for the added
span’s, development was an iterative process and it just fell out of one of the iterations. ;-) Again, not a JS or DOM person, but I’ll clean that up. Thanks for the tips!By Andy on Oct 22, 2007 | Reply
I see that the plugin also works on static pages (not blog pages). That’s great - thanks!
By Billifer on Oct 22, 2007 | Reply
@ Andy–Glad you like it and find it useful! I’m pretty happy with it myself. :)
By count-0 on Oct 23, 2007 | Reply
Thank You for this plugin and the continous improvements, but after installing the current version 1.1 from WP plugin dictionary I recognized garbled output in case an obfuscated address is handled by ‘the_excerpt()’. Being a WP newbie (< 10 days) I am still not in the core code, but to me it seems like there is the script tag missing in conjunction with the_excerpt(). The HTML produced:
My actual workaround is simply to write a teaser text for articles having an email address appearing in the first 20 words which shouldn’t be the case to often anyway.
But if time and space allowed a fix “in situ” would be very nice. Of course should I stumble accross a solution I will report immediately.
By Billifer on Oct 23, 2007 | Reply
{{{ @ count-0 –
Thanks for noticing this. I hadn’t testing how the address would be handled in @the_excerpt()@, so I’ll have a new version ready for you soon! Be sure to check for the new version in your WP Admin (version 2.3+) or here or the “WP Plugins”:http://wordpress.org/extend/plugins/emob-email-obfuscator/ page. }}}
By Cakes on Oct 29, 2007 | Reply
Thanks for this plugin, we have been using it for a while and it’s very good. But I don’t like how it hides the visual output of the email address with a {at} and (.) in this new version. Is there a way to change this?
Maybe something to consider in the future is the option to use an image for the @ symbol, since I would like the user to see a normal email address, how they traditionally appear.
By Billifer on Oct 30, 2007 | Reply
{{{ Cakes–Yes, this is an issue that will be addressed in the next version. I should have it available very soon. When it has been posted, it will show up in your WP Dashboard if you’re running WordPress 2.3 or above, so be sure to check frequently for updates. Thanks for using eMob! }}}