Lots of people like to use contact forms on their site. But there may be situations where you’d want to provide a linked email address too, either showing the actual email address (like [email protected]) or some text of your choosing (like contact me).

Doing either is pretty easy. You just need to know the simple code.

Creating email links is basically just like making a regular link, but instead of putting http://  in front, you would use mailto:

For example, instead of linking [email protected], you would link mailto:[email protected]

The complete HTML for the above would be the following …

[email protected]">My Link Text

Of course, if you wanted to show the email address itself (but still link to it), the HTML would look like this …

[email protected]"> [email protected] 

You could even use the link function in the WordPress editor to help you build your links. A normal link is created with http://

http

When that pops up, just delete the http:// and use mailto: instead.

mailto

You can also pre-populate the email with a subject line by appending information after the email address like this (beginning with the question mark):

[email protected]?Subject=Hello%20There!">My Link Text

(Note: the characters “%20” above gives you space between the two words “Hello” and “There!”)

What About Spam?

When you put your email address out there so nakedly, you may be opening yourself up to more spam.

In order to combat that, there are email encoder plugins you can use. There are some who question the effectiveness of such encoding (depending on what type it is). And spammers are adjusting all the time, so it’s a matter of staying ahead of them. But some have found success with such plugins. You can test them out yourself.

One such plugin is the Email Encoder Bundle. While this plugin comes with a number of different options, including a form that will help you generate your email links, it will automatically go into action when activated, encoding mailto links like those above into gibberish.

One last tip…

If you mostly use Gmail for email, consider using email forwarding to protect your Gmail address from being spammed. Our email hosting service lets you send an email from [email protected], forward it to [email protected], and configure Gmail to ‘send as’ [email protected].

What do you think about linking an email address in WordPress? Let us know in the comments!

Tags: