There are a number of reasons why you might want to display an email address in a post: providing your own contact information, providing a support contact for a company or product you’re writing about, and so on.
However, simply including an email address in your post is simply asking for an email harvester to nab it, adding it to a spammer’s database.
WordPress has a function for obfuscating email addresses, making it all the more difficult for the spammer’s to nab them with a harvester.
To add a shortcode to your Thesis-powered WordPress install, simply drop the following into your custom_functions.php
file:
# Email obfuscation shortcode
function custom_email_shortcode( $atts , $content = null ) {
return antispambot( $content );
}
add_shortcode( 'email', 'custom_email_shortcode' );
This is about as simple as it gets. Usage:
The only thing scary about actually using an email address is that the spambots get THAT much smarter each day. It just takes one…. :)
This is nifty nevertheless. Also, love the Thesis specific bits of code!
Ideally, i recommend using reCAPTCHA’s MailHide service to obfuscate email addresses; however, i’m not quite sure how to easily turn it into a WordPress shortcode. When i do, i’ll be posting it.
You’re right, though; the email harvesters are getting better all the time, which is why i encourage everyone to participate in Project Honey Pot.