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:
Join the Discussion