Contact forms are a fairly standard feature on websites and WordPress makes it easy to add one to yours using a shortcode. Learn how to configure the contact form shotcode and add it to a page. You'll also learn that contact forms are not guaranteed secure and should not be used to send sensitive information.
- [Voiceover] A fairly standard feature of a website is a contact form. And in this movie, I'd like to walk you through how you can add one to your site. First, I'm gonna create a page and title it Contact. I'll go ahead and publish it. Next, I'm gonna get a little help. From my profile, I can click on the help section and then I'll do a search for contact form. This brings up some great documentation on how I can add a contact form to my site, and we're gonna follow these instructions together. WordPress has built-in shortcodes we can use to create our contact form.
If you're not familiar with the term shortcode, it's a WordPress specific code that lets you do awesome things with very little effort. Shortcodes can embed files or create things that would normally require lots of complicated code. Think of a shortcode as as shortcut. So here's the shortcode for a basic contact form. Let's break this down. We can see that the form is wrapped in this contact form shortcode. Within that are the various form fields. In this case, one for name, email, website, and a comment area.
I'm gonna go ahead and copy this entire thing and then paste it into my contact page. I'll go back to my site, find the contact page, and click on the title to edit it. Then I'll paste in the contact form. For my example, let's say I don't care about website. So, I can just go ahead and remove that line. Let's save this and take a look. I can do that by using this View Page button. You might wonder why the name and email fields are already populated. That's because I'm logged in. If your site visitors are logged in to wordpress.com, the form would pre-populate with their information.
If they're not logged in, these fields would be empty. So yeah, that's a good looking form. So, let's say I want to change this label. I can do that by going back to the shortcode and replacing this text. I'll click Update and then let's view it again. There I can see the text has been updated. The last thing I need to do is tell this shortcode where to send a notification when this form is submitted. Going back to the documentation, I can see there's an option for that. I can add to to the opening contact form shortcode.
I can even add a subject line if I wanted. I'll add that, save it, and now whenever this form is filled out, I'll get an email notification. Pretty cool, eh? One giant disclaimer to make here. Information sent by email is not secure. Don't use this form to submit any sensitive information, like credit card numbers. Okay, that was my public service announcement. To see what other options you have for contact forms, just check the support documentation.
- Creating a WordPress.com account
- Updating your profile
- Importing content
- Publishing posts
- Applying categories and tags to posts
- Inserting images, videos, and other media
- Creating a new page
- Customizing your site with themes and widgets
- Managing users, notifications, and comments
- Using WordPress.com apps
- The limits of WordPress.com and the benefits of self-hosting