How to Add Email Links in WordPress (2023 Guide)
Allowing visitors to quickly contact you via email is an important part of building an engaging website. Fortunately, WordPress makes it easy to add clickable email links anywhere on your site.
In this guide, you‘ll learn everything you need to know about creating email links in WordPress, including:
- How to add an email link in the WordPress editor
- Manually adding email links using HTML
- Best practices for effective email links
- Alternatives to consider for reducing spam
Whether you‘re a blogger, business owner, or web developer, mastering email links in WordPress is a valuable skill. Let‘s get started!
Creating an Email Link in the WordPress Editor
The easiest way to add an email link in WordPress is directly in the post/page editor. Here‘s how:
- Open the post or page where you want to add the email link
- Select the text you want to make clickable
- Click the "Link" button in the toolbar (or use the keyboard shortcut Ctrl/Cmd+K)
- Type the email address you want to link to in the URL field
- Click the "Apply" button
WordPress will automatically detect that you entered an email address and add the proper "mailto:" link format. So if you type "john@example.com", WordPress will convert it to:
When a visitor clicks that link, it will open their default email client and pre-populate a new message to that address. The visitor can then write and send their email as usual.
You can also add email links to text that isn‘t an email address. For example:
- Type the text you want visitors to click, like "Contact Me"
- Select that text and open the link tool
- Paste the full email link, including the "mailto:" prefix
So to make "Contact Me" link to john@example.com, you would enter:
mailto:john@example.com
The clickable text can be anything you want. Some other common examples are:
- Email Us
- Send a Message
- Get In Touch
Use clear and enticing link text to encourage visitors to click and start composing an email to you.
Adding Email Links Using HTML
If you need to add an email link outside the post editor, like in a text widget, menu, or theme file, you‘ll need to write the HTML code manually. Fortunately, the code for email links is quite simple:
Just replace the email address and link text with your own. You can use this HTML anywhere in WordPress that accepts HTML code.
One advantage of writing email links in HTML is you have more flexibility and control. In addition to specifying the address and link text, you can also pre-populate the email subject line and body text by adding special parameters to the mailto link:
The above link would open a new email with the subject "Inquiry from website" and message body "Hi John, ". This saves the visitor a bit of typing and helps clarify the purpose of the message.
You can also make an email link open in a new tab by adding target="_blank" to the link:
With these techniques, you can craft email links perfectly suited to your content and goals.
Avoiding Spam and Protecting Privacy
One downside of publishing email addresses on your website is it makes them vulnerable to being harvested by spam bots and added to lists. If you start getting tons of junk email to an address you link to on your site, this is likely the reason.
To mitigate this problem, consider only linking to dedicated email addresses used specifically for this purpose, rather than primary accounts. You can also use a contact form plugin like WPForms to allow visitors to send you messages without revealing your actual email address.
There are also techniques to obscure email addresses from bots while still keeping them clickable for human visitors. One common method is to use JavaScript to construct the email link dynamically. Here‘s an example:
var part1 = "john";
var part2 = Math.pow(2,6);
var part3 = String.fromCharCode(part2);
var part4 = "example.com"
var addr = part1 + String.fromCharCode(part2) + part4;
document.write("Email John");
This code uses variables and ASCII values to piece together the email address in a way that is difficult for basic spam bots to parse, but transparent to human visitors.
While not foolproof, tactics like these can help reduce unwanted spam to your linked email addresses. If spam becomes a major problem, you may want to remove direct email links and rely solely on contact forms.
Making Effective Email Links
To get the most impact from email links on your WordPress site, consider the following tips and best practices:
Use clear, compelling link text. Don‘t just use the email address as the linked text – write a strong call-to-action that makes people want to click. Text like "Email me for a free quote" or "Contact us to learn more" is much more effective than just an email address.
Place email links intuitively. Put email links where visitors expect to find them, like the footer and contact page. You can also add email links contextually throughout your content where relevant.
Style links to stand out. Using a contrasting color or underline helps draw attention to email links. Just make sure they remain distinct from regular text links.
Set user expectations. Let visitors know what to expect when clicking an email link. Identify who they‘ll be contacting, typical response times, or what they should include in the message.
Test your links. After adding an email link, send a test message to make sure it works properly. Also check the link across devices to ensure it functions on mobile.
Track link clicks. Using tracking tools lets you see how often your email links are clicked, and from where. This data helps optimize placement and refine your calls-to-action.
By thoughtfully crafting and placing your email links, you can boost engagement and make it painless for visitors to get in touch. Over time, A/B testing different link text and placements can help optimize conversions.
Conclusion
Adding email links to your WordPress site is an easy yet effective way to connect with your audience and generate leads.
Whether you link to email addresses in the WordPress editor or manually write the HTML code, WordPress offers the tools and flexibility you need to create engaging email links anywhere on your site.
By following email link best practices and monitoring results, you can continually refine your strategy to maximize clicks and conversions while protecting your inbox from spam.
So if you have an email address you want to promote on your WordPress site, put these techniques into practice and start making meaningful connections with your visitors today. Your inbox will thank you!
