Keep your e-mail address secret from scrapers and spammers - ΩJr. Software Articles and Products

This information lives on a web page hosted at the following web address: 'https://omegajunior.globat.com/code/'.

This javascript does show your e-mail address to javascript-enabled devices like web browsers, but not to search crawlers and web scrapers.

A.E.Veltstra
Original: 1996.
Fully reviewed: 26 Nov. 2012.

Do you too, hate spam? One of the reasons you receive it, is because you publish your e-mail address on your web site. So don't.

Then how can people contact you?

Then apply a bit of javascript code, that assembles your e-mail address, and you execute that code in reaction to clicking a hyperlink.

Example hyperlink:
<a title="Mail me" href="javascript: sendMeMail;">Click here to mail me</a>

Example javascript to make the above work:
<script type="text/javascript">/* <![CDATA[ */
function sendMeMail() {
document.location="mailto:name@server.com";
}
/* ]]> */</script>

Place it in the HEAD of your web page, and go!

Extras
- We can extend this script by adding variables for different addresses and mail subject lines.
- If you really don't want a spider robot to recognise your mail addresses, you can hack them to bits and reassemble them in realtime.
- We can't replace the @ by its HTML entity (&amp;at;), because not all e-mail clients understand that... but we can replace it with an ascii sign within the script.

Cloudflare
The OmegaJunior Consultancy uses Cloudflare as CDN. Cloudflare however was meant to increase website security, including the obfuscation of email addresses. If you go with Cloudflare, you won't need to implement above functionality yourself.

Need problem solving?

Talk to me. Let's meet for coffee or over lunch. Mail me at “omegajunior at protonmail dot com”.