You’ve probably seen clickable email addresses around the web like this, [email protected].
If you click that email address, it will open your computer’s default email client. So how do you add links like this to your WordPress site?
Here’s the easy way to add email links to posts and pages, plus the HTML you can use for menus and widgets.
How to create Mailto: links
UPDATE: Watch my new video tutorial to learn how to add clickable email addresses in the new Gutenberg editor as well as menus and widgets too.
HTML5 introduced some new link types including the special email link or Mailto link. WordPress helps you automatically link email addresses without touching the HTML.
First, type a plain email address into a post or page. Then highlight the email address text and click the link icon in the editor.
Alternatively, press cmd+k (ctrl+k) to use the link shortcut.
WordPress will recognize the email address and automatically insert the correct Mailto link for you.
Just press the enter/return key to add the link and you’re done.
How email links work
When linking to a website, you include “http://” at the beginning. All links require a protocol and “http://” is the hypertext protocol we use for linking to webpages.
Mailto is a different protocol. It’s used when linking to an email address. In practice, you just need to remember to use “mailto:” instead of “http://” when linking to an email address.
The Mailto link HTML
If you’re adding the link to a widget or menu, you won’t have the automatic Mailto link creation that you get in the post editor.
This is how the URL should look when adding an email address link to a menu.
And here is the complete HTML for a Mailto link.
<a href="mailto:[email protected]">[email protected]</a>
Email links with WordPress
In this post, you learned how to add email links to any part of your site with WordPress by utilizing the HTML5 “Mailto” link.
Making email addresses clickable can make it easier for visitors to get in touch with you. You can even update the links to have a pre-written subject line.
If you have any questions about adding clickable email addresses to your site, please post a comment below.