


{"id":5315,"date":"2018-09-04T08:07:19","date_gmt":"2018-09-04T15:07:19","guid":{"rendered":"https:\/\/xmission.com\/blog\/?p=5315"},"modified":"2018-09-04T14:31:45","modified_gmt":"2018-09-04T21:31:45","slug":"how-to-add-a-contact-form-to-your-wordpress-website","status":"publish","type":"post","link":"https:\/\/xmission.com\/blog\/2018\/09\/04\/how-to-add-a-contact-form-to-your-wordpress-website","title":{"rendered":"How to add a contact form to your WordPress website"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-5386\" style=\"margin-top: -12px;\" src=\"https:\/\/xmission.com\/blog\/wp-content\/uploads\/2018\/08\/wordpress-email.png\" alt=\"\" width=\"124\" height=\"168\" \/>A contact form is the most straight-forward and ubiquitous way for your website visitors to send you comments and information. WordPress does not offer a native form tool, so this job calls for a plugin.<\/p>\n<p>Mandatory disclaimer: <em>DO NOT INSTALL UNTRUSTED PLUGINS!<\/em> Malicious plugins can compromise your website and destroy your data!\u00a0 I strongly suggest avoiding plugins with less than 5,000 installations and less than 4 stars.\u00a0 In the case of this article, I have vetted the Contact Form 7 plugin since 2012 without incident.\u00a0\u00a0I am in no way affiliated with the author of this plugin; I just like that it is straightforward, flexible and suits my needs as a developer. With that out of the way, let&#8217;s get a contact form set up!<\/p>\n<div style=\"background: #0290AE; padding: 6px 12px; color: white; font-size: 16px; margin-top: 1.75em; border-radius: 3px;\">Step 1: <strong>Install the Contact Form 7 Plugin<\/strong>.<\/div>\n<p>Login to your WordPress admin (typically www.yoursite.com\/wp-admin) and click on <strong>Plugins<\/strong> then <strong>Add New<\/strong> in the left hand menu. In the search field top right, enter &#8220;<strong>Contact Form 7<\/strong>.&#8221; It should look like this:<br \/>\n<a href=\"https:\/\/xmission.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_1.png\"><img decoding=\"async\" class=\"wp-image-5316\" style=\"margin: 0.5em 0;\" src=\"https:\/\/xmission.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_1.png\" alt=\"\" width=\"100%\" \/><\/a><br \/>\nTo install, click<strong>\u00a0Install Now<\/strong> then <strong>Activate<\/strong> after the installation completes (usually a matter of seconds).<\/p>\n<div style=\"background: #0290AE; padding: 6px 12px; color: white; font-size: 16px; margin-top: 1.75em; border-radius: 3px;\">Step 2: <strong>Create a new form<\/strong>.<\/div>\n<p>After Contact Form 7 is installed and activated, <strong>Contact<\/strong>\u00a0will appear in the left menu.\u00a0 Click it, then <strong>Add New<\/strong>.\u00a0 You&#8217;ll see something just like this:<br \/>\n<a href=\"https:\/\/xmission.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_2.png\"><img decoding=\"async\" class=\"wp-image-5326\" style=\"margin: 0.5em 0;\" src=\"https:\/\/xmission.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_2.png\" alt=\"\" width=\"100%\" \/><\/a>The default form is pretty useful as-is, or you can tweak it to suit your needs. There is an <a href=\"https:\/\/contactform7.com\/editing-form-template\/\">Editing Form Template<\/a> help page, or create your own form by using the buttons at the top of the form edit window. If you&#8217;d like to customize your form by hand, read the <a onClick=\"document.getElementById('email-form-tips').style.display = 'block'\";>Advanced Tips<\/a>.<\/p>\n<div id=\"email-form-tips\" style=\"display: none;\">\n<p><b style=\"font-size: 14px;\">Advanced Tips<\/b><\/p>\n<ul>\n<li>Each form input needs to be wrapped in <span style=\"font-family: monospace;\">&lt;label&gt;<\/span> and <span style=\"font-family: monospace;\">&lt;\/label&gt;<\/span><\/li>\n<li>Right after <span style=\"font-family: monospace;\">&lt;label&gt;<\/span> is the text to appear above the form input. Customize this to your liking. For example, you could change &#8220;Your name&#8221; to &#8220;Who dis?&#8221;<\/li>\n<li>Inside the [square brackets] are two pieces of information: first is the type of input, next is the unique name to assign to the input. An asterisk * next to the input type designates a required field.<\/li>\n<li>The last item in your form should always be a submit button: <span style=\"font-family: monospace;\">[submit &#8220;Send&#8221;]<\/span>. Again, the first item in the brackets is the input type (a submit button), and inside the quotes is the text to show on the button. You can customize this as well.<\/li>\n<\/ul>\n<\/div>\n<div style=\"background: #0290AE; padding: 6px 12px; color: white; font-size: 16px; margin-top: 1.75em; border-radius: 3px;\">Step 3: <strong>Configure the Mail settings<\/strong>.<\/div>\n<p>From the same page you are on, click the <b>Mail<\/b> tab to set up how your form will send emails to you.<br \/>\n<a href=\"https:\/\/xmission.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_2b.png\"><img decoding=\"async\" class=\"alignleft wp-image-5334\" style=\"margin: 1.5em 2em 1.5em 0;\" src=\"https:\/\/xmission.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_2b.png\" alt=\"\" width=\"50%\" \/><\/a><br \/>\nFirst and most important, who do you want the email sent <b>To<\/b>? Enter your preferred address for receiving emails from this form.<\/p>\n<p>Next, who will the email be sent <b>From<\/b>? It&#8217;s being sent from your website, but all emails need a valid sender address. This email address cannot be the same as the &#8220;To&#8221; address you entered above. I suggest\u00a0<b>no-reply@yourdomain.com<\/b> where <i>yourdomain.com<\/i> needs to be the domain your form is on. In the screenshot you&#8217;ll see an error is displayed because the example email address <span style=\"font-family: monospace;\">&lt;no-reply@yourdomain.com&gt;<\/span> is not valid.<\/p>\n<p>The <b>Subject<\/b> field sets the subject of the email your form will send.\u00a0<span style=\"font-family: monospace;\">&#8220;[your-subject]&#8221;<\/span> will be whatever was entered in the form field <span style=\"font-family: monospace;\">[text your-subject]<\/span>.<\/p>\n<p><b>Additional Headers<\/b> is really handy for setting the <span style=\"font-family: monospace;\">Reply-to [your-email]<\/span> to whatever your visitor entered in the <span style=\"font-family: monospace;\">[your-email]<\/span> field of the form.<\/p>\n<div style=\"background: #0290AE; padding: 6px 12px; color: white; font-size: 16px; margin-top: 1.75em; border-radius: 3px; clear: both;\">Step 4: <strong>Add your form to a page<\/strong>.<\/div>\n<p>At the top of the page (see the Step 2 screenshot) you&#8217;ll notice the text &#8220;<i>Copy this shortcode and paste it into your post, page, or text widget content:<\/i>. That&#8217;s exactly what you need to do now. Click the shortcode to highlight the text and <b>CTRL-C<\/b> to copy it. Now navigate to the page or post you want the form to appear on.<br \/>\n<a href=\"https:\/\/xmission.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_3.png\"><img decoding=\"async\" class=\"wp-image-5327\" style=\"margin: 0.5em 0;\" src=\"https:\/\/xmission.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_3.png\" alt=\"\" width=\"100%\" \/><\/a><br \/>\nPlace the cursor where you want the form to appear and press <b>CTRL-V<\/b> to paste the shortcode. Publish\/save the page and you are DONE! Your form should look something like this:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-5378\" style=\"margin: 0.5em 1.5em 1.5em -17px;\" src=\"https:\/\/xmission.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_4.png\" alt=\"\" width=\"430\" height=\"440\" title=\"This is an image, not a real form\" \/>The exact appearance will be determined by your theme.<\/p>\n<p>There&#8217;s one last thing you&#8217;ll want to do before you break out the champagne: Test your form by sending a test to yourself. If you reply to your test email, you can have an endless conversation with yourself!<br \/>\n<br clear=\"all\" \/><br \/>\n Like this tutorial? When you buy a hosting package from XMission for your WordPress site, our support team will share other tips and tricks while helping you keep your site running flawlessly. <a href=\"https:\/\/xmission.com\/hosting\">Visit our hosting page<\/a> for more details.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A contact form is the most straight-forward and ubiquitous way for your website visitors to send you comments and information. WordPress does not offer a native form tool, so this job calls for a plugin. Mandatory disclaimer: DO NOT INSTALL UNTRUSTED PLUGINS! Malicious plugins can compromise your website and destroy your data!\u00a0 I strongly suggest [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,240],"tags":[663,41,664],"class_list":["post-5315","post","type-post","status-publish","format-standard","hentry","category-tips-helpful-information","category-wordpress","tag-blog","tag-email","tag-forms"],"_links":{"self":[{"href":"https:\/\/xmission.com\/blog\/wp-json\/wp\/v2\/posts\/5315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xmission.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xmission.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xmission.com\/blog\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/xmission.com\/blog\/wp-json\/wp\/v2\/comments?post=5315"}],"version-history":[{"count":77,"href":"https:\/\/xmission.com\/blog\/wp-json\/wp\/v2\/posts\/5315\/revisions"}],"predecessor-version":[{"id":5492,"href":"https:\/\/xmission.com\/blog\/wp-json\/wp\/v2\/posts\/5315\/revisions\/5492"}],"wp:attachment":[{"href":"https:\/\/xmission.com\/blog\/wp-json\/wp\/v2\/media?parent=5315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xmission.com\/blog\/wp-json\/wp\/v2\/categories?post=5315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xmission.com\/blog\/wp-json\/wp\/v2\/tags?post=5315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}