This plugin is outdated. I suggest you use WP-reCAPTCHA instead!
As you might’ve read in my My Fight Against Spam post, I have been using reCAPTCHA on this blog as well as on The Instagib Project Wiki with great success. I’ve even turned off Akismet and I still don’t get any spam. Well, they also have a service called Mailhide which lets users hide their email addresses. People who would like to see the address then have to fill an easy CAPTCHA and the address is revealed.
After realizing that there were no other plugins for WordPress like this, I decided to write my own. I use the Mailhide API, and make it easier on myself by using the PHP Library for reCAPTCHA. If you want to use this, you’ll have to get your free (No registration required either) API keys here.
This plugin is a filter that scans for email addresses in posts, pages, comments, RSS feeds, and hides them and inserts a link where one could reveal it. It doesn’t actually modify the database, so if you remove this plugin, your email addresses won’t stay that way. Instead, it modifies the text after it’s been extracted from the database, when the viewer needs it.
If you remove this plugin and you still see the addresses as they were, you’re probably running a cache plugin and you need to flush it. It is important to note that I’m no expert in PHP and this is the first plugin I’ve written for WordPress. You can see it in action here on this site. If you notice anything wrong with the plugin please let me know or submit a patch and I’ll fix it.
Google Groups is using a similar system. To see for yourself, go to any discussion list such as this one.
Requirements
- API keys which you can get here.
- mcrypt PHP module which most installations have anyways. You can check if you have it by running the phpinfo() function in a PHP script.
Installation
Open up the wp-mailhide.php.
First, if you want emails to be styled, copy and paste the CSS code from readme.txt into your theme’s stylesheet and modify as wanted. You can see what that would look like by looking at the email addresses on this page.
Also, if you already have the reCAPTCHA Comment Plugin yet, then comment line 12, the one that says this:
require_once(dirname(__FILE__) . '/recaptchalib.php');
After you get your API keys from the place mentioned above, put them into the respective place in line 21 which is:
$html = recaptcha_mailhide_html('public key', 'private key', $matches[0]);
Also, if you don’t want addresses styled then comment out line 23:
$html = '<span class="emailrecaptcha">' . $html . "</span>";
If you do want it styled (To see what it looks like, look at the email addresses on this page), copy and paste this code into your stylesheet (wp-content/plugins/yourtheme/style.css):
.emailrecaptcha { border: none; padding: 2px; padding-left: 20px; background: transparent url('images/email.png') no-repeat left center; height: 16px; color: #2277DD; } .emailrecaptcha a, .emailrecaptcha a:hover, .emailrecaptcha a:visited, .emailrecaptcha a:visited:hover { color: #FF7700; font-weight: bolder; text-decoration: none; border: 0; }
Remember that you could modify the CSS to your liking.
Once you’re done with all of this, simply put the wp-mailhide folder in your wp-content/plugins/ folder, then activate the plugin.
Let me know what you think about this plugin and if you have any problems just let me know. Again this is my first ever WordPress plugin and I’m not expert in PHP.
Examples
blan...@gmail.com
blae...@gmail.com
Download WP-Mailhide 0.3 here.

Testing comment filter:
blan…@gmail.com
blae…@gmail.com
Hello,
just wanna say thank you for this awesome plugin.
Great work!
Kind regards, Thorsten
Glad you liked it! I was beginning to think no one liked it haha. Some might be turned off at the fact that one has to type in a CAPTCHA to get the email, but hey Google’s doing it! Besides, you can’t have everything in this world, it’s either Spam, Hidden Spam that keeps piling up in an Akismet Queue, or this. So far this has worked perfectly for me.
The only bad thing is that this is my first WordPress plugin so it’s not as polished. It doesn’t have an Admin interface and all of that. If it picks up, I’ll probably make one soon.
A few comments I would like to make,
- One, on your site, on a personal level I think the captcha looks better above the comment box. I guess if you are trying to get people to make the comment, THEN realize they have to do a captcha you are succeeding. I understand a webdesign is the authors choice and I don’t think of you as less of a person because you put it there, I just think that it makes the submit button too low and i kinda like just being able to press tab enter (my usual key combo after a blog comment)
- Two, I think you should code it in your blog to make it so you can now allow your email address to be publicly viewable that way if anyone wants to send a commenter an individual message they can have that option of the commenter is okay with it.
- Three, I really like your plugin and am about to upload it to my site right after I finnish typing this. reCAPTCHA is a great thing that helps with a great cause.
Take care,
Travis McCrea
blog.geeksparadox.com
team…@geeksparadox.com
Thanks for the comment!
1. Sorry, I’m confused. At first it looks like you would rather I have the reCAPTCHA box on top, right? By the way, you are able to quickly navigate through the form with TAB. Just type the comment, TAB, type the CAPTCHA, TAB, enter
Or did you mean something else? And yeah I figured that putting it under the comment box people would be more likely to post comments, plus I just think it looks more logical like that. Yeah you’re right though, the submit button is a bit too low, but I can see if I can put it a bit higher towards the bottom right of the comment box.
2. Sorry I don’t really understand? Commenters, like you just did, are able to post emails. The only thing is that if anyone wants to see the entire email one must click on the three dots, type in the CAPTCHA, and then see it. I don’t think there’s anything wrong with this? Do you mean maybe have a way to make it so that the plugin doesn’t hide the emails in your comment? That would leave you open to spammers though, which would defeat the purpose of this plugin. Sorry, I don’t really know what you meant by that.
3. You’re really welcome!
By the way, you do know that the comment CAPTCHA and the email hiding are two separate plugins right? The comment CAPTCHA (Which you can see under the comment box) is reCAPTCHA’s own plugin which you can find here. The email hiding is done by this plugin which I wrote, WP-Mailhide, which uses the reCAPTCHA Mailhide API.
Thanks again for the feedback! Sorry for not really understanding what you meant!
Sorry for being confusing.
Yes I like prefer the captcha above the comment box so when i am done typing i just press tab enter. That and it looks cleaner to me.
Yes, but i think that since you now have an email protection system in place you should have a check box that allows them to make their email public.
Test