Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Some time back I remember seeing a method of hiding an e-mail address used as a link from crawlers. Presently we have the address in simple text form, but the ideal would to be have it as a link.
Does anyone know of a way?
chejose

Here is the simple email text:
someone@domain.com
Here is the HTML hyperlink source:
< a href="mailto:someone@domain.com" > someone@domain.com < /a >
Either way, most spam crawlers can get the email address from both methods. All they usually do is search for the '@' sign and get the text either side.
Using Javascript is one employed method of hiding email addresses. However, it means people with Javascript disabled (many people do disable it) won't be able to email you. Another method would be to use an email form, which sends through a CGI/PHP/ASP/etc script. However, most people prefer to compose emails in their email client so I wouldn't recommend this method. (Or provide both a contact form and an email address.)
There are also some methods of CSS to hide your email address from spam bots/harvesters. Here's one example:
Cutting Edge CSS | Hiding Email Address
However, people on older browsers, text browsers or screen readers (makes up quite a significant percentage) most likely won't be able to access it.
Simple solution: just put a normal mailto: hyperlink, open for the spam harvesters to get but then employ strong filtering on your email server or email client. Probably the best spam filter I've used to date is the one built-in to Mozilla Thunderbird. If you use it for a month or so, you "teach" it how to sort spam and it really is quite intelligent.
I hope this helps,
James

You do know that it doesn't matter if it's in a mailto link or not, right? Plain text is picked up just as easily (if not easier) than an email address in a link.
You can use this Javascript function I wrote a while ago to obfusicate email addresses. Just put it in the HEAD of each document you want to use it, then where you want the email address printed, type <script>mail2('TLD', 'domain', 'user');</script>
function mail2(three, two, one)
{
document.write('<a href="mailto:' +
one + '@' + two + '.' + three + '">' +
one + '@' + two + '.' + three + '</a>');
}You may need to modify the code a bit if you want to make the A element a specific class, etc.
That should prevent any crawlers that don't actually render the webpage from getting your address. However, the only way to be REAL safe is to use images which is a big pain.

Very good. There are a couple of things to try. Actually probably the simplest is to use a graphic instead of text. As was mentioned, not all have java disabled.
Many thanks for the suggestions and for clarifying the matter.
JEY
chejose

Another tip of the hat to the backwards method James linked to...Very clever.
Using a graphic instead of text is fine...As long as you don't make it a mailto: link, since the e-mail address will still be picked up by the crawler.
Personally, I don't care about the 'mailto' link functionality, so I usually just put some invisible html in the address:
myaddress< b>< /b>@< b>< /b>hotmail.com.-SN
-SN

That page is pretty neat, huh? CSS tricks are my favourite to find out about. ;-)
@SN
What happens if the email harvester strips out HTML before grabbing the email address? Then it just sees it as plain text.
I still think leaving it as a normal mailto: link is best (no funny, potentially incompatible tricks). And then an intelligent spam filter.

My personal recommendation is to translate your address into HTML partially or in full. Browsers will still be able to interpret the code, but harvesting scripts will not. In this case, your email address will be clickable. For the ASCII code table, please see <http://www.ascii.cl>: andreeac@domain#46;com
If you're interested in SMS, visit my wife's site .

Doh. Fambi - your post reminded me that I'd actually updated that javascript function I posted above. When I went looking for it earlier, I grabbed the old one.
The syntax is the same, but the function is different. This is what I was using:
==========================================================
<script>function convert(text)
{
var newText = "";for (i=0; i<text.length; i++)
newText += "&#" + text.charCodeAt(i) + ";";return newText;
}function mail2(three, two, one)
{
one = convert(one);
two = convert(two);
three = convert(three);
var mailto = convert('mailto:');document.write('<a href="' + mailto +
one + '@' + two + '.' + three + '">' +
one + '@' + two + '.' + three + '</a>');
}
</script>Then just use it the same as before, typing:
<SCRIPT>mail2('TLD', 'domain', 'user');</SCRIPT>
This seemed to work pretty well for us. Since we started using this style, new email addresses haven't been picked up by spammers as fast as they used to be.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |