Anti-Spam Email Links

Hack or Fix 64 views
0
0 Flares 0 Flares ×

We all know that mailto links are a target for even the most simple bots. However there are things we can do to try to protect the mailto link from the bots getting hold of your email account and before you know it filling your inbox with spam!

<?php
	// Anti Spam Mailto Links
	// source: http://wpdaily.co/top-10-snippets/

function so_email_encode_function($atts, $content){
	return '<a href="'.antispambot($content).'">'.antispambot($content).'</a>';
}
add_shortcode('email', 'so_email_encode_function');
// Use shortcode [email]email@me.com[/email]

For Reference

Top 10 Snippets

Provided by: WP Daily
Tagged with: ,
Posted in Wordpress

Discuss:

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

No Trackbacks.

Login

Register | Lost your password?
0 Flares Twitter 0 Facebook 0 Google+ 0 0 Flares ×