Results 1 to 1 of 1

Thread: Tutorial: how to hide your email address from bots

  1. #1
    Join Date
    Jul 2009
    Location
    London, Uk
    Posts
    45

    Tutorial: how to hide your email address from bots

    I recently wrote a jQuery plugin for concealing email addresses on your website.

    A while ago I helped a friend setup a website with no serverside coding at all.
    There are still sites out there (along with people who only write html, and no serverside code) that are pure html.

    The lack of contact forms (or for whatever reason) makes it necessary to include the mailto: attribute in the <a> tags.

    This is pure chocolate cake for bots, crawling around looking for potential victims to spam, and nobody wants that!

    For that reason, I wrote a simple jQuery plugin that would change the <a> tags.

    Okay, enough drivel, let's get to it:

    This can be done in 3 simple steps:

    1) Change all
    Code:
    <a href="mailto:name@domain.com">email me</a>
    to
    Code:
    <a href="name@domain.com" class="mailto">email me</a>
    (Note: the class name is just a jQuery selector)

    2) include the email plugin (can be found here) in your page header

    3) In your document.ready call, add this code
    Code:
    $(document).ready(function() {
        $(".mailto").emailencode();
    });
    All done!
    Your email won't appear as standard mailto link and bots won't get their mitts on your email address, but your visitors can still benefit from using them.

    For more details and download link visit the ResourcePage on litetest.com
    Last edited by LiteTest; 01 Jan 2010 at 05:46 PM.
    litetest.com - Web analysis and evaluation reports of your website

Similar Threads

  1. how do i put a file upload on a form that sends to an email address?
    By flutebyjaclyn in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 14 Jun 2007, 06:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •