{"id":124765,"date":"2014-01-26T11:30:00","date_gmt":"2014-01-26T16:30:00","guid":{"rendered":"http:\/\/premium.wpmudev.org\/blog\/?p=124765"},"modified":"2022-03-02T05:35:07","modified_gmt":"2022-03-02T05:35:07","slug":"link-wordpress-email-address","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/link-wordpress-email-address\/","title":{"rendered":"How to Link an Email Address in WordPress"},"content":{"rendered":"<p>Lots of people like to use <a href=\"https:\/\/wordpress.org\/plugins\/forminator\/\" rel=\"noopener\" target=\"_blank\">contact forms<\/a> on their site. But there may be situations where you\u2019d want to provide a linked email address too, either showing the actual email address (like\u00a0<span style=\"text-decoration: underline;\"><span style=\"color: #61aee9; text-decoration: underline;\">email@myemail.com)<\/span><\/span> or some text of your choosing (like <span style=\"text-decoration: underline; color: #61aee9;\">contact me<\/span>).<\/p>\n<p>Doing either is pretty easy. You just need to know the simple code.<\/p>\n<ul>\n<li><a href=\"#links\">Creating Email Links<\/a><\/li>\n<li><a href=\"#spam\">What About Spam?<\/a><\/li>\n<li><a href=\"#last-tip\">One last tip\u2026<\/a><\/li>\n<\/ul>\n<h2 id=\"links\">Creating Email Links<\/h2>\n<p>Creating email links is basically just like making a regular link, but instead of putting <i>http:\/\/<\/i>\u00a0 in front, you would use <i>mailto:<\/i><\/p>\n<p>For example, instead of linking email@myemail.com, you would link mailto:email@myemail.com.<\/p>\n<p>The complete HTML for the above would be the following \u2026<\/p>\n<pre>&lt;a href=\"mailto:email@myemail.com\"&gt;My Link Text&lt;\/a&gt;<\/pre>\n<p>Of course, if you wanted to show the email address itself (but still link to it), the HTML would look like this \u2026<\/p>\n<pre>&lt;a href=\"mailto:email@myemail.com\"&gt; email@myemail.com &lt;\/a&gt;<\/pre>\n<p>You could even use the link function in the WordPress editor to help you build your links. A normal link is created with <i>http:\/\/<\/i> <i>&#8230;<\/i><\/p>\n<div class=\"image-grid cgrid-row\">\n<div class=\"cgrid-col cgrid-col-span-full\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-125327\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2014\/01\/http.jpg\" alt=\"http\" width=\"700\" height=\"285\" \/><\/div>\n<\/div>\n<p>When that pops up, just delete the <em>http:\/\/<\/em> and use<em> mailto:<\/em> instead.<\/p>\n<div class=\"image-grid cgrid-row\">\n<div class=\"cgrid-col cgrid-col-span-full\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-125328\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2014\/01\/mailto.jpg\" alt=\"mailto\" width=\"700\" height=\"285\" \/><\/div>\n<\/div>\n<p>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):<\/p>\n<pre>&lt;a href=\"mailto:email@myemail.com?Subject=Hello%20There!\"&gt;My Link Text&lt;\/a&gt;<\/pre>\n<p>(Note: the characters \u201c%20\u201d above gives you space between the two words \u201cHello\u201d and \u201cThere!\u201d)<\/p>\n<h2 id=\"spam\">What About Spam?<\/h2>\n<p>When you put your email address out there so nakedly, you may be opening yourself up to more spam.<\/p>\n<p>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\u2019s a matter of staying ahead of them. But some have found success with such plugins. You can test them out yourself.<\/p>\n<p>One such plugin is the <a href=\"http:\/\/wordpress.org\/plugins\/email-encoder-bundle\/\" target=\"_blank\">Email Encoder Bundle<\/a>. 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 <i>mailto<\/i> links like those above into gibberish.<\/p>\n<h2 id=\"last-tip\">One last tip&#8230;<\/h2>\n<p>If you mostly use Gmail for email, consider using <a href=\"https:\/\/wpmudev.com\/docs\/hosting\/emails\/#email-forwarding\" target=\"_blank\" rel=\"noopener\">email forwarding<\/a> to protect your Gmail address from being spammed. Our <a href=\"https:\/\/wpmudev.com\/email-hosting\/\" target=\"_blank\" rel=\"noopener\">email hosting<\/a> service lets you send an email from <code>businessname@mydomain.com<\/code>, forward it to <code>yourname@gmail.com<\/code>, and configure Gmail to \u2018send as\u2019 <code>businessname@mydomain.com<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is as simple as building a regular link. You just have to know the trick.<\/p>\n","protected":false},"author":84404,"featured_media":206243,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[4,263],"tags":[106],"tutorials_categories":[],"class_list":["post-124765","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-plugins","category-tutorials","tag-email"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/124765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/84404"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=124765"}],"version-history":[{"count":6,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/124765\/revisions"}],"predecessor-version":[{"id":206606,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/124765\/revisions\/206606"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media\/206243"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=124765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=124765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=124765"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=124765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}