How to Post Your Email Address Online (while avoiding spammers)

Be careful of posting your email address online. A favorite technique of spammers is to “scrape” websites for email addresses. Then they can not only spam you but use your email address to send out spam to others.

One way to avoid this is to not make it a link; thus:

joesmith {at} gmail dot com

This is a rather weak way of prevention, as spammers can easily write a code to “escape” the alternative text characters that people use, and scrape your address anyway.

Another way to avoid spammers is to put your address inside a javascript code. Please remember that if you have a blog, the application’s software (PHP) may not allow you to put Javascript into a blog post. One of my favorite email encoders:


Below is information from WordPress:

Disguising Your Email

To “fool” e-mail harvesters, a simple method is to convert the symbols in an e-mail address to words (typically parenthesized). For example, becomes steve (at) mac (dot) com. Since this is not recognized as a valid e-mail format, harvesters tend to ignore it.

A slightly more complicated approach is to transform or encode characters in an address to their HTML character entity, or numeric character reference, equivalent. This means the letter a in an address becomes a, the @ symbol @, and so on. These should appear as gobbledygook to harvesters, while your browser renders them correctly.

You can use a free online encoder to encode your email address (here’s another tool to encode your email using Javascript) or use the antispambot() function built into WordPress:

<!--?php echo antispambot(get_the_author_email()); ?>-->

The function antispambot() above parses the e-mail address passed by get_the_author_email() (this is the same asthe_author_email(), except it returns rather than displays the author’s e-mail address). Use of the echo command displays the output of antispambot(). An interesting feature is it encodes only portions of an address, and does so randomly so the letters encoded are different each time the page loads, adding a little more firepower to the spam protection arsenal.

NOTE: Unfortunately, WordPress does not allow invalidly formatted e-mail addresses to be used in one’s profile, so obfuscating your e-mail address there will not work.

Use Images Instead of Plain Text Email Another easy trick for disguising your email is to create an image of your email address using some screen capture software, cropping it to size with an image editor, and inserting it where ever you like 🙂  Use Anti Spam Plugins There are some plugins that do this work automatically in posts and pages. For instance Email Address Encoder which converts all plain email addresses and mailto links into decimal and hexadecimal entities. Another one is CryptX. There are some drawbacks as if it’s not properly configured, they might mess with contact form where users introduce email addresses (if they make some mistake and the form is refilled and re-filtered).


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s