DIGIT-ARC read-only archive · snapshot: July 23, 2026

How to hide email address on website from robots?

9 posts · originally from https://geek.digit.in/community/threads/how-to-hide-email-address-on-website-from-robots.21452/

S
suhasingale Original post #1
Jan 3, 2006 at 10:38 AM
On the website *www.python.org/Jobs.html i found some email address links, now the funda over here is in IE6 when we move our mouse over this email address links see something like "%6A%68%6F%64%67%65%40%65%78%61%2E%63%6F%6D" instead of the email address and if we click on that the email id comes out also if we view the properties we are able to see the mail id. I have also downloaded the jobs.html from their FTP site and the coding over ther was
[*]Other Contact Info: J. Hodge, HR Manager, jhodge at exa dot com.

Someone please tel me how do i convert my email id's to such type of coding so that i can implement it on my website.
alib_i
alib_i #2
Jan 3, 2006 at 12:58 PM
Those are ASCII codes written in hexadecimal form.
It's a popular method to hide email addresses.

Read this page: Hexadecimal explained (scroll down to "Web Address" part)
To convert your email-addr to ASCII: Conversion Chart

Interestingly Firefox shows the email address normally .. even on mouse hover.
Moreover if you want to hide your email address .. then the best method is to create an image with your addr written .. that'll surely defeat all kinds of bots :)

-----
alibi
siriusb
siriusb #3
Jan 3, 2006 at 1:15 PM
Hmm, I was actually writing a function in javascript to replace all mailto: addresses when I saw this. It's simple and uses escape() function to do the job.
S
Jan 3, 2006 at 1:18 PM
alib_i said:
Interestingly Firefox shows the email address normally .. even on mouse hover.
-----
alibi

I also observered this but forgot to mention it in my post. But anyways u were of gr8 help for me. Thanks buddy.
S
Jan 3, 2006 at 1:19 PM
siriusb said:
Hmm, I was actually writing a function in javascript to replace all mailto: addresses when I saw this. It's simple and uses escape() function to do the job.

I wud be very much thankful to u if u share ur script with us (if u don't mind).
siriusb
siriusb #6
Jan 3, 2006 at 2:28 PM
Sure I will, if I finish writing it. The escape () function only urlencodes the string. Converting html to Hex is what is required. Let me learn that first.

[edit] I think this ought to be done at the server side, coz I can't make the source code to change. Only the behaviour changes. Currently, this code works only with IE. I don't know why. I am new to javascript.
Code:
<script language="javascript">
function unes ()
{
	var ace=document.getElementsByTagName ('a');
	for (x=0; x<ace.length; x++) 
	{
		if (ace[x].href.toLowerCase ().indexOf ('mailto:') == 0)
			myUrlEncode (ace[x].href.substr (7), ace[x]);
	}

/* From *computercops.biz/viewlink-80.html */
	function myUrlEncode(str, urlLink)
	{
		var result = "";
		var i = 0;

		for (i=0; i < str.length; i++)
		{
			result = result + "%";
			result = result + "0123456789ABCDEF".charAt((str.charCodeAt(i)/16)&0x0F);
			result = result + "0123456789ABCDEF".charAt((str.charCodeAt(i)/1)&0x0F);
		}
	
		urlLink.href = "mailto:" + result; /*Set the test hyperlink with this value*/
	}
}
</script>
alib_i
alib_i #7
Jan 3, 2006 at 3:37 PM
To convert string to ASCII in PHP ...

Code:
$encoded = strrev(chunk_split(strrev(bin2hex($string)), 2, '%'))

if $string="me@my.com"
then $encoded="%6d%65%40%6d%79%2e%63%6f%6d"
you can take care of rest of it.

PS: I just saw siriusb has posted a javascript code for the same :)

-----
alibi
Deep
Deep #8
Jan 3, 2006 at 5:55 PM
Try this piece of code out: *www.jracademy.com/~jtucek/email/download.php
S
Jan 3, 2006 at 9:54 PM
Thanks to siriusb,alib and deep