cialis online pharmacy generic xenical cheap cialis online cialis generic viagra online in canada buy cheap levitra online cialis without a perscription order viagra uk no prescription flagyl cheap generic levitra buying viagra in the uk cheap viagra approved cialis deltasone online buy viagra online without prescription non prescription cialis buy orlistat uk buy cialis in india prednisone 60 mg female viagra online buy viagra without prescription celebrex prescriptions buy cialis canada best prices viagra alternative to prednisone cheapest generic levitra levitra 5mg cheap viagra cialis on line buy xenical without prescription online accutane canadian health care prednisone no prescreption viagra online generic female viagra europe buy cialis low price cheap india viagra

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.

Related Posts


5 Great Image Plugins for WordPress

Themeum’s Flat Theme Multipurpose WordPress Theme

Weblizar Premium Responsive Theme

Automattic Buys WooCommerce Plugin for WordPress