How to add a contact form in wordpress

Last Updated: Jan 22, 2024 by

Are you looking to add a contact form to your WordPress website? A contact form is an essential tool for any website, allowing visitors to easily get in touch with you. In this article, we’ll show you how to add a contact form to your WordPress website without using a plugin.

Why Add a Contact Form to Your WordPress Website?

A contact form is a convenient and professional way for visitors to reach out to you. It also helps to protect your email address from spam and ensures that all inquiries are organized in one place.

Benefits of Using a Contact Form Without a Plugin

While there are many contact form plugins available for WordPress, there are also benefits to creating a contact form without using a plugin:

  • Reduced Plugin Overload: By not using a plugin, you can reduce the number of plugins on your website, which can improve site speed and performance.
  • Customization: Creating a contact form without a plugin allows for more customization options, giving you more control over the design and functionality of your form.
  • Less Vulnerability: Using fewer plugins can also reduce the risk of security vulnerabilities on your website.

How to Create a Contact Form Without a Plugin

Step 1: Create a Contact Form Page

The first step is to create a new page on your WordPress website where you want the contact form to appear. To do this, go to Pages > Add New in your WordPress dashboard.

Creating a new page

by Kelly Sikkema (

Give your page a title, such as “Contact Us” or “Get in Touch”. You can also add any additional content you want to appear on the page, such as a brief description of your business or contact information.

Step 2: Add the Contact Form Code

Next, you’ll need to add the contact form code to your page. WordPress has a built-in contact form feature that you can use to generate the code for your form.

To access this feature, go to Settings > Writing in your WordPress dashboard. Scroll down to the “Contact Form” section and click on “Contact Form 1”.

Contact form settings

by Jotform (

This will open a new page with the code for your contact form. Copy the code and paste it into the text editor on your contact form page.

Contact form code

by Markus Spiske (

Step 3: Customize Your Contact Form

Now that you have the basic contact form code on your page, you can customize it to fit your needs. You can add or remove fields, change the labels, and adjust the styling.

To add or remove fields, you’ll need to edit the code. For example, if you want to add a “Phone Number” field, you can add the following code after the “Your Email” field:

Phone Number

To change the labels, simply edit the text within the tags. For example, if you want to change “Your Name” to “Full Name”, you would edit the code to look like this:

Full Name

To adjust the styling, you can use CSS. You can either add the CSS code directly to your page or add it to your theme’s stylesheet. For example, if you want to change the font size of the form labels, you can add the following code:

label { font-size: 18px; }

Step 4: Add a Submit Button

By default, the contact form code does not include a submit button. To add one, you can use the following code:

You can also customize the submit button by adding a class or ID and styling it with CSS.

Step 5: Test Your Contact Form

Once you have customized your contact form, it’s important to test it to make sure it’s working properly. Fill out the form and click the submit button to see if you receive the email notification.

If you don’t receive the email, there may be an issue with your server’s email settings. You can also try using a different email address to see if the issue is with your email provider.

Tips for Customizing Your Contact Form

Use HTML5 Input Types

HTML5 introduced new input types that can be used to validate user input. For example, you can use the type=”email” attribute to ensure that the user enters a valid email address. You can also use type=”tel” for phone numbers, type=”url” for URLs, and more.

Add Required Fields

To ensure that users fill out all the necessary information, you can add the required attribute to your form fields. This will prevent the form from being submitted until all required fields are filled out.


To prevent spam submissions, you can add a CAPTCHA to your contact form. A CAPTCHA is a type of challenge-response test used to determine whether the user is human or a bot. There are many plugins available for adding a CAPTCHA to your contact form, or you can use a third-party service like Google reCAPTCHA.


Adding a contact form to your WordPress website is a simple and effective way to allow visitors to get in touch with you. By creating a contact form without using a plugin, you can reduce plugin overload, customize your form, and improve site security. With these tips and steps, you can easily add a contact form to your WordPress website and start receiving inquiries from potential customers.

Moadood Ahmad

About the Author: Moadood Ahmad

Leave a Reply

Your email address will not be published. Required fields are marked *