Automatically Hide Email Addresses From Spambots
Spambots are one of the most annoying things you have to deal with when running a website or blog. They scan your site for email addresses just so it can be used for sending out spam. Well, thanks to a certain Stian Jacobsen, he was nice enough to share this nifty snippet to help you combat those annoying programs.
function security_remove_emails($content) { $pattern = '/([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4})/i'; $fix = preg_replace_callback($pattern,"security_remove_emails_logic", $content);
return $fix; } function security_remove_emails_logic($result) { return antispambot($result[1]); } add_filter( 'the_content', 'security_remove_emails', 20 ); add_filter( 'widget_text', 'security_remove_emails', 20 );
This code helps prevent spambots from detecting any email addresses that you may have in your site simply by hiding them. All you have to do is to insert the code into your functions.php file and that’s it. Once the file’s saved, the code filter content and widget content to hide all emails from the nasty critters.
Incoming search terms for the article:
- blogger hide email address
- web design hide email address javascript
- received a email about spam bots 2012
- js hide automatically hide all emails on page
- javascript mask email address on website
- html webdesign hide e-mail from bots
- how to hide email with css
- hiding email from spam bots
- hide email from spam bots jquery
- hide email address with flash