Rot13 Email Protection for Wordpress, protects all email addresses and mailto: links on your blog from email harvesters using rot13 encryption and/or text mode.
Inspired by ROT13 encryption on Textmate;
I’ve developed this plugin a while ago, i’ve now updated it to a releasable version, already working up to wordpress 2.5.1
ROT13 Email Protection at Worpress Plugins
Download ROT13 Email Protection Plugin v0.1!
In order to install it, as most wordpress plugins, just put the rot13_email_protection.php file inside your /wp-content/plugins folder.
Any bugs, give me a comment, i’ll check on it.

![[del.icio.us]](http://techtrouts.com/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://techtrouts.com/wp-content/plugins/bookmarkify/digg.png)
![[Facebook]](http://techtrouts.com/wp-content/plugins/bookmarkify/facebook.png)
![[Twitter]](http://techtrouts.com/wp-content/plugins/bookmarkify/twitter.png)
August 14th, 2008 at 2:52 pm
Hi,
Looks like a greate plugin. However, when I activate the plugin in a WP 2.6 installation all text in post that contains links of any kind disapears. This happens for both post and pages. Any idea how to fix this?
October 19th, 2008 at 6:01 pm
Yeah, same thing happens to me. It does seem great and I hope you have a chance to update it. Thanks for the work either way. :)
January 30th, 2009 at 5:00 pm
[...] Rot13 Email Protection for Wordpress, protects all email addresses and mailto: links on your blog from email harvesters using rot13 encryption and/or text mode. By 9tree. Download Plugin! Version 0.1 Last Updated: June 30, 2008 Visit Plugin’s Home Visit Plugin @ WordPress.com [...]
February 5th, 2009 at 11:07 pm
Great plugin – but it seems to have problems when there’s an excerpt that contains a link (not a mailto link). Then it times out. Any ideas?
March 28th, 2009 at 5:02 pm
I also experienced the issue with content disappearing. I made the following change and all seems well:
function rot13_email_protection($text) {
global $ROT13_EP_GEN_PATTERN;
$replacement = preg_replace_callback($ROT13_EP_GEN_PATTERN, “rot13_protection_callback”, $text);
if ($replacement) {
return $replacement;
} else {
return $text;
}
}
YMMV. Hope this helps someone.
May 2nd, 2009 at 2:10 am
Bob, I tried your code, and the only thing that did was return the text without the rot13 encoded email.
This maybe a problem with PHP 5.2+, when pcre.backtrack_limit was introduced . I ran preg_last_error(); after the preg_replace_callback, and it was returning “PREG_BACKTRACK_LIMIT_ERROR”. I ended up rewriting the regex to something simpler, and it works without issue now.
May 21st, 2009 at 2:40 pm
I had the disappearing page problem as well, only stranger. With a blog installed on my test domain (1and1 host), afaik wp2.7, it worked fine. On my client’s domain (BlueHost), also with wp2.7, it blanked several pages, both with mailto links and some with individual particular standard (not mailto) links.
August 7th, 2009 at 10:28 pm
Joel, what did you change? I’m having the same problem as Mike, pages with regular links are blanked out.
August 20th, 2009 at 10:47 pm
It seems in my case that the blanking pages is caused by php5. Using php4 fixes the problem.
Any idea why the plugin doesn’t work correctly with php5?
August 31st, 2009 at 10:40 pm
Null is returned when preg_replace_callback fails so to test against it and output is a failsafe (Bob’s comment). This then won’t convert the Email but will display the page. Simplest way is to simplify ROT13_EP_GEN_PATTERN to be less greedy and fit your needs (Joel’s comment).
October 6th, 2009 at 2:50 pm
Nick, here is the regex I used. I’m not a regex expert by any means, but this is what worked for me in the blog I was creating. So you may need to customize if it doesn’t work.
Starting on line 34, replace the following variable (goes to line 35):
$ROT13_EP_GEN_PATTERN=”/(<a.*?mailto)(.*?)/i”;
Hope this helps!
October 6th, 2009 at 2:56 pm
I’ve tested it with Joel’s changed code at a hoster, where I ran into the white screen problem. And now it works like a charm.
October 21st, 2009 at 5:53 am
Joel, you are a life saver! That works great. I had to type it in since copying the text caused an error (because of the quotes) but it worked fine after that.
Now we can use some PHP5-based plugins we couldn’t use before.
Thanks!
November 11th, 2009 at 7:49 am
Hey there, tried Joel’s solution, and while the content outputs, it mangles the email addresses & links. Here’s what comes out:
/* =(c=c.charCodeAt(0)+13)?c:c-26);})); /* ]]-> */ :email@email.com”>email@email.comViewing source shows me this:
<script type="text/javascript">/* <![CDATA[ */
document.write("<n uers=\"znvygb".replace(/[a-zA-Z]/g, function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);}));
/* ]]-> */
</script>:email@email.com”>email@email.com</a>
November 11th, 2009 at 7:50 am
Whoops, forgot to finish that thought. Anybody have any ideas on how to make it work? Running PHP5, FYI.
November 11th, 2009 at 7:51 am
Wait, got it. Here’s the RegEx that worked for me:
$ROT13_EP_GEN_PATTERN='%(<a.*?mailto)(.*?)%i';November 11th, 2009 at 7:57 am
Stupid copy not working *grumble grumble* Here it is:
$ROT13_EP_GEN_PATTERN='%(<a.*?mailto)(.*?)%i';November 11th, 2009 at 7:58 am
Or this blog is eating my code. And now, correctly escaped to avoid being eaten:
$ROT13_EP_GEN_PATTERN='%(<a.*?mailto)(.*?</a>)%i';November 29th, 2009 at 4:06 pm
Jeff,
To fix the problem you are having, replace Joel’s solution with the following:
$ROT13_EP_GEN_PATTERN=”/(<a.*?mailto)(.*?)()/i”;
November 29th, 2009 at 4:14 pm
OK. Apparently this blog filters certain content in the comments. For the fix, visit the link below…
http://docs.google.com/View?id=dcbd9g22_51ftbrkkhf