-1

I have a wordpress website in which we have used widgets and we have added html mail like this

<a href="mailto: myemail.examlple.com"> my email </a>

I want to protect this email id from spams when user did view source.

I already disabled copy paste. Any idea?

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
Hitesh
  • 57
  • 6

1 Answers1

1

Quoted Fuhrmanator (Effective method to hide email from spam bots)

This is the method I used, with a server-side include, e.g. <!--#include file="emailObfuscator.include" --> where emailObfuscator.include contains the following:

<!-- // http://lists.evolt.org/archive/Week-of-Mon-20040202/154813.html -->
<script type="text/javascript">
    function gen_mail_to_link(lhs,rhs,subject) {
        document.write("<a href=\"mailto");
        document.write(":" + lhs + "@");
        document.write(rhs + "?subject=" + subject + "\">" + lhs + "@" + rhs + "<\/a>");
    }
</script>

To include an address, I use JavaScript:

<script type="text/javascript"> 
    gen_mail_to_link('john.doe','example.com','Feedback about your site...');
</script>
<noscript>
  <em>Email address protected by JavaScript. Activate JavaScript to see the email.</em>
</noscript>

Because I have been getting email via Gmail since 2005, spam is pretty much a non-issue. So, I can't speak of how effective this method is. You might want to read this study (although it's old) that produced this graph:

enter image description here

Community
  • 1
  • 1
Xatenev
  • 6,383
  • 3
  • 18
  • 42