WordPress email text link
I recently had the need to create an email text link for WordPress. Which, when clicked, would set up a blank email to a chosen email address. The person in the article did not have a website. So that path could not be used for contact. They only had an email and that was the only method that they wished to use. So I had the email and a new problem.
I found two methods of building the email links within a post and two additional variations. All except the link builder method in the WordPress editor require you to enter the line in text mode, not visual mode.
Method #1
- The following line links an email to the text “My email address”
<a href=”mailto:[email protected]”>My email address</a>
Variation #1
- The following links an email to the actual email text
<a href=”mailto:[email protected]”> [email protected] </a>
Variation #2
- This line fills the email with a subject line beginning with the question mark
<a href=”mailto:[email protected]?Subject=Hello%20I%20Have%20A%20Question!”>My Link Text</a>
(Note: the characters “%20” above creates a space between two words)
Method #2
- You could use the link function in the WordPress editor to build your email links. A normal link is created with http://
When that pops up, just delete the http:// and use mailto: instead.
I like the first three methods. You can slip the three lines into a cheat sheet and when needed you can set up the line with the right email and text link and then copy and paste into your Word Press post. In my instance, this is perfect since I will not have to remember how to do it. It’s just a few steps away from being done for the next time it’s needed.
This is how I would save it on my cheatsheet.
This is how to do an email text link
<a href=”mailto:addemail@here”>text to display on post</a>
This is how to do an email link to a displayed email address in post
<a href=”mailto:addemail@here”>the real email goes here</a>
This is how to do an email link to text with subject line on opening of email.
<a href=”mailto:addemail@here?Subject=Hello%20I%20Have%20A%20Question!”>text to display on post</a>
There you have it, two methods, two alternate variations to get that email linked to text.
Related WordPress Articles: Other WordPress Articles
( By WordPress.Nafsadh at en.wikipedia [GPL (http://www.gnu.org/licenses/gpl.html)], from Wikimedia Commons )
Making the free time after the retirement into the useful work quite innovative idea.
Hello Garry,
Thanks for the comment. I am glad that found this website. I hope you found the information useful. It is surprising how busy we can be once we are retired.
Ray C.