Articles, tips, and resources for webmasters

a project by Michael Bluejay | email

More on using hiding email addresses with Submit buttons

On our stopping spam page we list the use of a Submit button as one way to hide an email address from spammers. The idea is that the Submit button takes the user to a new page, and that page shows the email address. The idea behind this is that spammers don't gather addresses manually, they use automated programs called spambots to scour the web and lift email addresses from web pages. Spambots scour the web by following <A HREF> links; most of them aren't smart enough to click a button.

There are various ways to code your Submit button, each of which has pros and cons.

Coding Method


<FORM ACTION="addresses.html" METHOD=GET><INPUT TYPE=submit NAME=Submit VALUE="See Addresses"> </FORM>

Some spambots might be smart enough to find the "addresses.html" file that the button points to.

<INPUT TYPE=submit NAME=Submit VALUE="See Addresses" onclick="a='addresses'; b='.html'; window.href=a+b;">

This hides the address of the destination page with JavaScript. This requires that the user have JavaScript and have it enabled, but 98% of users do.

(Require the user to type in a randomly-generated code that you display on the screen.)

This would be completely effective at stopping spambots, because they can't type in the code, but it would greatly annoy your visitors. Many will click off the site if you make it inconvenient for them to send email. This method would also require a fair bit of programming, which is outside the scope of this page.

back to STOPPING SPAM: How to keep spambots from stealing email addresses from websites