Sell more with better email & SMS

Get ecommerce-focused email & SMS marketing that makes it easier to grow your brand, get sales & build better relationships.

Drive sales on autopilot with ecommerce-focused features

See Features

How to link to an email in WordPress: why you should use a contact form

Reading Time: 9 minutes

Trying to link to an email in WordPress?

Great idea in theory. But not so great in practice.

If you’re set on adding a link to email in WordPress, you can do so by hyperlinking the text.

But if you don’t want bad actors to harvest your email, this isn’t the best strategy.

Thankfully, you have other options.

This guide explains how to link to an email on WordPress without leaving yourself vulnerable to spam. We also provide a better alternative — using contact forms.

Join Omnisend today and create stunning signup forms that convert

Understanding ‘mailto’ links

‘Mailto’ links look like regular hyperlinks. The only difference is when a visitor clicks on one, their email client opens the compose window with a pre-populated address field, like so:

Mailto links example

WordPress makes it easy to create clickable email links. Just open a WordPress post, type out and highlight your email address, then press ctrl+K to create a mailto link.

Want more specifics?

Let’s take a look at the step-by-step process.

Easily build your email list with Omnisend’s interactive popups & forms

How to add an email link in WordPress

There are two ways to add an email link in WordPress: the hyperlink button, and HTML.

We’re going to cover both techniques here, but we should repeat that mailto is not a suggested practice because of the risks of spam bots and other malicious activity.

If you’re uncomfortable with this and want a better way to link emails, just skip to the bottom and learn about the advantages of contact forms.

Otherwise, let’s take a closer look at adding an email link in WordPress.

Adding email links in WordPress using the hyperlink button

This is the fastest and easiest method of linking to an email in WordPress.

Step 1: Write your anchor text. Let’s use ‘contact us today.’

Email link in WordPress

Step 2: Highlight your text and click the hyperlink button at the center of the editing box. You should see something like this:

Email link in WordPress

Step 3: Type in ‘mailto:’ followed by your email address. There should be no spaces.

Email link in WordPress

Step 4: Press enter (or click the blue arrow). Your mailto link is ready to go.

Email link in WordPress

Step 5: Click Publish or Update in WordPress to confirm your changes. The WordPress link to email process is complete.

Email link in WordPress

Adding email links in WordPress using HTML

You can also use code to embed a mailto link. This is the only way to add a clickable email link to a text widget or WordPress theme file.

For the sake of clarity, let’s assume you’re using this method on a WordPress post.

Step 1: Select the post you want to edit and select ‘text’ instead of ‘visual.’ It should look like this:

email links in WordPress via HTML

Step 2: Add the following code to the text box:

<a href=”mailto:[email protected]”>Contact us today</a>

email links in WordPress via HTML

Step 3: Click update or publish. Your mailto link is now live.

If you want to, you can also customize your mailto links with subject lines, images, and more.

Let’s discuss these in the section below.

Customizing email links

With a pinch of code and some elbow grease, you can customize your mailto links with colors, styles, and even pre-populated text.

Here are three ways to customize your email links.

1. Pre-populate subject lines in email links

Here’s how to link an email address in WordPress and pre-populate subject lines for users.

Step 1: Paste your mailto link into a WordPress post. It should look something like this:

<a href=”mailto:[email protected]”>Contact us today</a>

Step 2: Add ?subject= to the end of your email address. Then, add the word you want in the subject line after the = symbol. Your code should now read:

<a href=”mailto:[email protected]?subject=Hello”>Contact us today</a>

Here’s what this looks like:

Email link customization

Step 3: If your subject line contains spaces or special characters, you need to encode them otherwise they won’t appear. To add a space, you’d write %20. Special characters have their own encodings — the exclamation mark, for example, is %21.

So if you wanted the subject line to be “Hello there!” you would write the following:

<a href=”mailto:[email protected]?subject=Hello%20there%21″>Contact us today</a>

2. Customizing email link appearance and texts

If you want to change the color or style of your mailto link, you have to use CSS (aka Cascading Style Sheets).

Luckily, this isn’t difficult to do.

Let’s say you want to create an orange link in italics:

Step 1: Start with your basic mailto code.

<a href=”mailto:[email protected]”>Contact us today</a>

Step 2: Next, add ‘style=’ after the href field. You need to include the color and text-decoration friends followed by a semicolon.

Here’s what that looks like:

<a href=”mailto:[email protected]” style=”color: orange; text-decoration: italic;”>Contact us today</a>

This should be the final result:

Customizing email link appearance and texts

3. Using images or icons

If you don’t want to use basic anchor text, you can turn an image or icon into a contact button.

Step 1: Download the image you wish to use (or remember the name of the image). Ours is going to be ‘contact-button.png.’

If you’re not sure what your file URL is, click Add mediaselect the imagecopy URL to clipboard.

copy URL to clipboard example

Step 2: Insert an <img> tag inside your <a> tag. For example:

<a href=”mailto:[email protected]”><img src=”contact-button.png” alt=”Contact us today”></a>

Your result should look something like this:

Email link customization - images

Using plugins for email links in WordPress

Apart from being a magnet for spam, direct email links in WordPress come with several limitations.

There are three in particular you should know up front:

  1. You may accidentally send users to the wrong account on multi-account devices. If the recipient has multiple email addresses on their device, the mailto link may choose the wrong one. In some cases, this could mean the user’s personal email address rather than their business address.
  2. The populated default email provider may not be the one your user prefers. For example, many computers have Outlook installed as default, although nearly a third of email users prefer Gmail instead.
  3. Malicious actors love to scrape accessible email addresses, including those attached to mailto links. Even if you run a relatively small website, you may wind up with hundreds of unwanted spam messages.

Mailto links were once the industry standard, but today, they’re unnecessary, outdated, and potentially harmful.

That’s why the easiest and safest alternative to mailto is the contact form.

Let’s take a look at a few anti-spam WordPress plugins offering contact forms you can start using today.

Best anti-spam WordPress plugins

Contact form plugins are simple to use and add a professional polish to any WordPress website.

We’re going to look at four of the most popular, starting with one of the highest rated on G2:

1. Omnisend

anti-spam WordPress plugin - Omnisend
Image via Omnisend

Omnisend is an all-in-one email and SMS marketing platform. You can create signup forms and send automated emails with a plan that’s free forever — and with hundreds of customizable templates, it doesn’t take long to get started.

Once you’ve built a signup form for your website, you can lean into features like mobile forms and Wheel of Fortune. With US merchants seeing a $72 ROI for every dollar spent, Omnisend is one of the easiest ways to collect email addresses and phone numbers.

2. Jetpack

anti-spam WordPress plugin - Jetpack
Image via Jetpack

Jetpack offers contact forms that are uniquely integrated with AI. Once you supply a prompt with your needs and parameters, it will try to generate a design.

Just keep in mind you only get 20 free requests with Jetpack’s generative AI. If you’re not confident in your prompting abilities, you may want to manually build your form instead.

3. Ninja Forms

anti-spam WordPress plugin - Ninja Forms
Image via WordPress

Ninja Forms is a drag-and-drop contact form builder and a low-code solution for those unfamiliar with HTML. You can also set up payment forms with sites like PayPal or Stripe, which may be useful if you’re an ecommerce site taking online payments or donations.

However, you should know Ninja Forms only serves one function: to build forms on your website. You won’t have access to other tools like advanced email automations, SMS functionality, or web push notifications.

4. Contact Form 7

anti-spam WordPress plugin - Contact Form
Image via WordPress

Contact Form 7 is a WordPress plugin supporting verification tools like CAPTCHA and Akismet spam filtering. If you want to save submitted contact forms for future use, you can also download its companion app Flamingo.

While Contact Form 7 may be a good fit for experienced builders, it’s not always a friendly option for those without coding experience. It’s also the subject of many low reviews — mostly due to its unsafe email config.

Create your first contact form with Omnisend today.

Avoiding spam and protecting email addresses

If you’re stillset on mailto links instead of contact forms, please don’t wait to find additional spam protection.

Email encoder plugins will be key for your safety.

You may want to investigate solutions like:

Email encoder
Image via WordPress
Email adress encoder
Image via Email Address Encoder

Remember: posting your email address as a mailto makes it easy for spammers to harvest it. This can lead to your inbox receiving huge volumes of spam emails, or becoming the target of malicious attacks.

Advantages of contact forms over direct email links

As we’ve discussed, it’s better to create a contact form instead of dropping mailto links on your website. It’s not just about the safety factor — speed and convenience are also major benefits.

Compared with a mailto link, a contact form can:

  • Cut back on spam: Spambots can harvest mailto links and repurpose the addresses for malicious purposes. Contact forms, especially those with CAPTCHA or other anti-spam measures, are much less susceptible to this.
  • Boost user experience: Contact forms are a quick and easy way for visitors to reach out without leaving your website. It’s a seamless experience and more user-friendly compared to clicking on a mailto link and navigating to an inbox.
  • Organize and collect data: Multi-step contact forms and signup forms help you capture information for future use. You can create specific fields for names, phone numbers, and subject lines to store necessary details in an organized manner.
  • Add customization and branding: You can customize a mailto link, but not in the same way as a contact form. Not only can you change the colors or backgrounds, but you can also customize form fields based on the type of information you need.
  • Automate responses: With contact forms, you can set up automated responses to acknowledge the receipt of the users’ messages. This provides immediate feedback to senders — something you can’t do with mailto links.
  • Integrate with CRM and marketing tools: If you use customer relationship management (CRM) systems and marketing tools, you can easily integrate them with contact forms. This streamlines workflows and automates repetitive tasks like adding contacts to a mailing list or database.
  • Ensure accessibility for users without a default email client: Not all users set a default email client, which is required for mailto to work effectively. Since contact forms are universally accessible through web browsers, you don’t have to worry about potential snafus.

Wrap up

Mailto links are quick and convenient. But with their risks and limitations, it’s better to use contact forms instead.

Omnisend’s signup forms make it easy to get contact information without sacrificing your safety online. Our free plan offers everything needed to grow your contact list, including integrations with the tools you’re already using.

Ready to enhance your WordPress skills? You can sign up with Omnisend and build your first contact form today.

Richard White
Article by
Richard White

Richard is a Content Marketing Manager at Omnisend. An avid writer, he's said to have been born holding a pencil. Fascinated by all things handmade, if he's not reading or writing he can often be found practicing leathercraft.


related features
These are the Omnisend features that can help you get the results mentioned in the article.