I show email on my website as following
<a href="mailto:[email protected]">Email</a>
But I read the following while analysing my website using woorank.com, what should I do to avoid this?
Malicious bots scrape the web in search of email addresses and plain text email addresses are more likely to be spammed.
As a website operator you're advised to include your email address on your website so that you can easily be contacted by visitors. The problem with including your e-mail address is that you could find yourself inundated with spam.
Download spam filtering tools and anti-virus software Spam filtering tools and anti-virus software can help to scan the emails that you received for malware. If the emails that you received contain malware, the malicious content would be quarantined and you would be prevented from opening it.
In the past I have seen this done with javascript. Basically you assign the email address to javascript variables and change the contents of an element using these. You can also provide a fallback for users with javascript disabled which points them in the direction of a form if you need to. Here's an example
var user = 'foo', domain = 'bar.com', element = document.getElementById('email'); element.innerHTML = user + '@' + domain; //OR //'<a href="mailto:' + user + '@' + domain + '">Email</a>'
This way bots never see the email address as they do not load javascript.
Well, you can figure out a different way every day. Here's one using jQuery.
<a class="mail" href="mailto:[email protected]">e-mail</a>
Then handle the click with jQuery.
$('a.mail').on('click', function(){ var href = $(this).attr('href'); $(this).attr('href', href.replace('badmail.', '')); });
The reason I like this is that I can let the spammers spam the dummy mail domain thinking they got yet another e-mail harvested. If I was maintaining my own spam filter, I could collect samples to my bad bucket.
Also, this approach allows you to render the page quite clean with dynamic data and simply have the javascript snippet only once on the whole site to handle the real user clicks.
Works also on mobiles.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With