**UPDATE** I’ve released a slightly modified version of this into a plugin that has a TinyMCE button. You can get it here.
Folks that have been on the web for any length of time know that putting your email address on a forward-facing website is just asking for spam. While Gmail and other providers are pretty good at flagging them, it’s still an unnecessary burden, especially if you are using your own mailserver. But for many businesses and sites, you’ve gotta have it out there. So what to do?
The folks over at catswhocode recently published a post with a handful of WP shortcodes, one of which was obfuscating an email address using a convoluted regex and count method. Well, you could do that. But why not use a built-in WP function?
WordPress has an antispambot function that’s been in core since version 0.71. The only problem is that you can’t use it in a post, page, or widget on it’s own. So I’ve written a simple shortcode to allow you to call that function wherever you may need it.
This would go into your functions.php file
that’s it. And remember, if you need to use this (or any shortcode) in a widget, you’ll need to enable it if your theme hasn’t already done so.