{"id":117235,"date":"2014-06-23T10:54:01","date_gmt":"2014-06-23T08:54:01","guid":{"rendered":"http:\/\/designmodo.com\/?p=117235"},"modified":"2025-11-11T10:13:35","modified_gmt":"2025-11-11T10:13:35","slug":"wordpress-contact-form","status":"publish","type":"post","link":"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/","title":{"rendered":"How To Build a WordPress Contact Form"},"content":{"rendered":"<p>One feature common to almost every website in the world is the <strong>contact form.<\/strong> It can be used to collect feedback, complaints or useful information from website clients and users.<\/p>\n<p>A typical contact form consists of the following fields &#8211; sender name, sender email address, email subject and the message.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-117238\" src=\"https:\/\/strictthemes.com\/articles\/wp-content\/uploads\/2024\/06\/contact-form-wordpress.jpg\" alt=\"Create Contact Form WordPress\" width=\"600\" height=\"496\" \/><\/p>\n<p>In this tutorial, you will learn to build a simple contact form with a WordPress plugin.<\/p>\n<h3>Contact Form PHP Class Synopsis<\/h3>\n<p>The <strong>contact form<\/strong> PHP class will consist of a property and six methods (known as &#8220;functions&#8221; in procedural programming).<\/p>\n<p>[php]<br \/>\n&amp;lt;?php<br \/>\nclass Designmodo_contact_form {<br \/>\nprivate $form_errors = array();<\/p>\n<p>function __construct() {<br \/>\n\/\/ &#8230;<br \/>\n}<\/p>\n<p>static public function form() {<br \/>\n\/\/ &#8230;<br \/>\n}<\/p>\n<p>public function validate_form() {<br \/>\n\/\/ &#8230;<br \/>\n}<\/p>\n<p>public function send_email() {<br \/>\n\/\/ &#8230;<br \/>\n}<\/p>\n<p>public function process_functions() {<br \/>\n\/\/ &#8230;<br \/>\n}<\/p>\n<p>public function shortcode() {<br \/>\n\/\/ &#8230;<br \/>\n}<\/p>\n<p>}<br \/>\n[\/php]<\/p>\n<p>The private property <code>$form_errors<\/code> is an array that will store all the errors that will be generated by the contact form. I will explain what each class method does as we walk through the coding of the contact form plugin.<\/p>\n<h3>Coding the Contact Form Plugin<\/h3>\n<p>Like other WordPress plugins, the header is the first thing to go into the plugin file. Below is our contact form header followed by the class declaration and property.<\/p>\n<p>[php]<br \/>\n&amp;amp;amp;lt;?php<\/p>\n<p>\/*<br \/>\n  Plugin Name: Designmodo Contact Form<br \/>\n  Plugin URI: https:\/\/designmodo.com<br \/>\n  Description: Simple Contact form plugin that just work<br \/>\n  Version: 1.0<br \/>\n  Author: Agbonghama Collins<br \/>\n  Author URI:<br \/>\n *\/<\/p>\n<p>class Designmodo_contact_form {<\/p>\n<p>    private $form_errors = array();<br \/>\n[\/php]<\/p>\n<p>The contact form will be embedded in WordPress via shortcode <strong>[contact_form_dm]<\/strong>.<\/p>\n<p>The magic <code>__construct()<\/code> method handles the registration of the shortcode so it is recognizable by WordPress.<\/p>\n<p>[php]<br \/>\nfunction __construct() {<br \/>\n\/\/ Register a new shortcode<br \/>\nadd_shortcode(&#8216;contact_form_dm&#8217;, array($this, &#8216;shortcode&#8217;));<br \/>\n}<br \/>\n[\/php]<\/p>\n<p>The contact form HTML code will be in the static <code>form()<\/code> method.<\/p>\n<p>[php]<br \/>\nstatic public function form() {<br \/>\n        echo &#8216;&amp;lt;form action=&amp;quot;&#8217; . $_SERVER[&#8216;REQUEST_URI&#8217;] . &#8216;&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;&#8217;;<br \/>\n        echo &#8216;&amp;lt;p&amp;gt;&#8217;;<br \/>\n        echo &#8216;Your Name (required) &amp;lt;br\/&amp;gt;&#8217;;<br \/>\n        echo &#8216;&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;your-name&amp;quot; value=&amp;quot;&#8217; . $_POST[&amp;quot;your-name&amp;quot;] . &#8216;&amp;quot; size=&amp;quot;40&amp;quot; \/&amp;gt;&#8217;;<br \/>\n        echo &#8216;&amp;lt;\/p&amp;gt;&#8217;;<br \/>\n        echo &#8216;&amp;lt;p&amp;gt;&#8217;;<br \/>\n        echo &#8216;Your Email (required) &amp;lt;br\/&amp;gt;&#8217;;<br \/>\n        echo &#8216;&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;your-email&amp;quot; value=&amp;quot;&#8217; . $_POST[&amp;quot;your-email&amp;quot;] . &#8216;&amp;quot; size=&amp;quot;40&amp;quot; \/&amp;gt;&#8217;;<br \/>\n        echo &#8216;&amp;lt;\/p&amp;gt;&#8217;;<br \/>\n        echo &#8216;&amp;lt;p&amp;gt;&#8217;;<br \/>\n        echo &#8216;Subject (required) &amp;lt;br\/&amp;gt;&#8217;;<br \/>\n        echo &#8216;&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;your-subject&amp;quot; value=&amp;quot;&#8217; . $_POST[&amp;quot;your-subject&amp;quot;] . &#8216;&amp;quot; size=&amp;quot;40&amp;quot; \/&amp;gt;&#8217;;<br \/>\n        echo &#8216;&amp;lt;\/p&amp;gt;&#8217;;<br \/>\n        echo &#8216;&amp;lt;p&amp;gt;&#8217;;<br \/>\n        echo &#8216;Your Message (required) &amp;lt;br\/&amp;gt;&#8217;;<br \/>\n        echo &#8216;&amp;lt;textarea rows=&amp;quot;10&amp;quot; cols=&amp;quot;35&amp;quot; name=&amp;quot;your-message&amp;quot;&amp;gt;&#8217; . $_POST[&amp;quot;your-message&amp;quot;] . &#8216;&amp;lt;\/textarea&amp;gt;&#8217;;<br \/>\n        echo &#8216;&amp;lt;\/p&amp;gt;&#8217;;<br \/>\n        echo &#8216;&amp;lt;p&amp;gt;&amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;form-submitted&amp;quot; value=&amp;quot;Send&amp;quot;&amp;gt;&amp;lt;\/p&amp;gt;&#8217;;<br \/>\n\t\techo &#8216;&amp;lt;\/form&amp;gt;&#8217;;<br \/>\n    }<br \/>\n[\/php]<\/p>\n<p>The <code>validate_form<\/code> method which accept the contact form values as it argument, will validate and ensure that:<\/p>\n<ul>\n<li>No form field is unfilled or empty.<\/li>\n<li>The sender name is not less than four characters.<\/li>\n<li>The sender email is valid<\/li>\n<\/ul>\n<p>To keep things simple and succinct, we will stick to the above validation rule. Below is the code for the <code>validate_form<\/code> method.<\/p>\n<p>[php]<br \/>\npublic function validate_form( $name, $email, $subject, $message ) {<\/p>\n<p>        \/\/ If any field is left empty, add the error message to the error array<br \/>\n        if ( empty($name) || empty($email) || empty($subject) || empty($message) ) {<br \/>\n            array_push( $this-&amp;gt;form_errors, &#8216;No field should be left empty&#8217; );<br \/>\n        }<\/p>\n<p>        \/\/ if the name field isn&#8217;t alphabetic, add the error message<br \/>\n        if ( strlen($name) &amp;lt; 4 ) {<br \/>\n            array_push( $this-&amp;gt;form_errors, &#8216;Name should be at least 4 characters&#8217; );<br \/>\n        }<\/p>\n<p>        \/\/ Check if the email is valid<br \/>\n        if ( !is_email($email) ) {<br \/>\n            array_push( $this-&amp;gt;form_errors, &#8216;Email is not valid&#8217; );<br \/>\n        }<br \/>\n    }<br \/>\n[\/php]<\/p>\n<p>The <code>send_email()<\/code> method sanitize and send the mail to the administrator email address.<\/p>\n<p>[php]<br \/>\npublic function send_email($name, $email, $subject, $message) {<\/p>\n<p>        \/\/ Ensure the error array ($form_errors) contain no error<br \/>\n        if ( count($this-&amp;gt;form_errors) &amp;lt; 1 ) {<\/p>\n<p>            \/\/ sanitize form values<br \/>\n            $name = sanitize_text_field($name);<br \/>\n            $email = sanitize_email($email);<br \/>\n            $subject = sanitize_text_field($subject);<br \/>\n            $message = esc_textarea($message);<\/p>\n<p>\t\t\t\/\/ get the blog administrator&#8217;s email address<br \/>\n            $to = get_option(&#8216;admin_email&#8217;);<\/p>\n<p>            $headers = &amp;quot;From: $name &amp;lt;$email&amp;gt;&amp;quot; . &amp;quot;\\r\\n&amp;quot;;<\/p>\n<p>            \/\/ If email has been process for sending, display a success message<br \/>\n            if ( wp_mail($to, $subject, $message, $headers) )<br \/>\n                echo &#8216;&amp;lt;div style=&amp;quot;background: #3b5998; color:#fff; padding:2px;margin:2px&amp;quot;&amp;gt;&#8217;;<br \/>\n                echo &#8216;Thanks for contacting me, expect a response soon.&#8217;;<br \/>\n                echo &#8216;&amp;lt;\/div&amp;gt;&#8217;;<br \/>\n        }<br \/>\n    }<br \/>\n[\/php]<\/p>\n<p>Take note, mail will be sent to the blog administrator or owner&#8217;s email address programmatically retrieved by the WordPress <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/get_option\/\">get_option<\/a> function. The <code>send_email()<\/code> method ensure there isn&#8217;t any contact-form generated error before sending the email.<\/p>\n<p>Next is the <code>process_functions<\/code> method. This method call and process the <code>form<\/code>, <code>validate_form<\/code>, <code>send_email<\/code> methods.<\/p>\n<p>[php]<br \/>\npublic function process_functions() {<br \/>\n        if ( isset($_POST[&#8216;form-submitted&#8217;]) ) {<\/p>\n<p>\t\t\t\/\/ call validate_form() to validate the form values<br \/>\n            $this-&amp;gt;validate_form($_POST[&#8216;your-name&#8217;], $_POST[&#8216;your-email&#8217;], $_POST[&#8216;your-subject&#8217;], $_POST[&#8216;your-message&#8217;]);<\/p>\n<p>            \/\/ display form error if it exist<br \/>\n            if (is_array($this-&amp;gt;form_errors)) {<br \/>\n                foreach ($this-&amp;gt;form_errors as $error) {<br \/>\n                    echo &#8216;&amp;lt;div&amp;gt;&#8217;;<br \/>\n                    echo &#8216;&amp;lt;strong&amp;gt;ERROR&amp;lt;\/strong&amp;gt;:&#8217;;<br \/>\n                    echo $error . &#8216;&amp;lt;br\/&amp;gt;&#8217;;<br \/>\n                    echo &#8216;&amp;lt;\/div&amp;gt;&#8217;;<br \/>\n                }<br \/>\n            }<br \/>\n        }<\/p>\n<p>        $this-&amp;gt;send_email( $_POST[&#8216;your-name&#8217;], $_POST[&#8216;your-email&#8217;], $_POST[&#8216;your-subject&#8217;], $_POST[&#8216;your-message&#8217;] );<\/p>\n<p>        self::form();<br \/>\n    }<br \/>\n[\/php]<\/p>\n<p>Firstly, the method check if the contact-form has been submitted. If true, it call the <code>validate_form<\/code> to validate the form values and display the form generated message. The <code>send_email<\/code> is also called to send the email to the administrator.<\/p>\n<p>Finally, the <code>form<\/code> to display the contact-form HTML form.<\/p>\n<p>Earlier, we added a <code>add_shortcode<\/code> inside the magic <code>__construct<\/code> method to register the plugin shortcode to WordPress<\/p>\n<p>[php]<br \/>\nadd_shortcode(&#8216;contact_form_dm&#8217;, array($this, &#8216;shortcode&#8217;));<br \/>\n[\/php]<\/p>\n<p>The second argument passed to the function is the shortcode callback method <code>shortcode(),<\/code> which is called when the shortcode is used.<\/p>\n<p>[php]<br \/>\npublic function shortcode() {<br \/>\n        ob_start();<br \/>\n        $this-&amp;amp;amp;gt;process_functions();<br \/>\n        return ob_get_clean();<br \/>\n    }<\/p>\n<p>}<br \/>\n[\/php]<\/p>\n<p>The class would be useless if it isn&#8217;t instantiated. Finally, we instantiate the class to put it to work.<\/p>\n<p>[php]<br \/>\nnew Designmodo_contact_form;<br \/>\n[\/php]<\/p>\n<h3>How To Use the Contact Form Plugin<\/h3>\n<p>To embed the contact form in WordPress posts or pages, use the shortcut <strong>[contact_form_dm]<\/strong>, while in a theme template, use the code below:<\/p>\n<p>[php]<br \/>\n&amp;lt;?php echo do_shortcode(&#8216;[contact_form_dm]&#8217;); ?&amp;gt;<br \/>\n[\/php]<\/p>\n<p>Below is a screenshot depicting a message has been successfully sent via the contact form.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-117239\" src=\"https:\/\/strictthemes.com\/articles\/wp-content\/uploads\/2024\/06\/contact-form-message-sent.jpg\" alt=\"Contact form\" width=\"600\" height=\"540\" \/><\/p>\n<h3>Conclusion<\/h3>\n<p>A lot of contact form plugins in the WordPress plugin repository are quite heavy and bloated. If you have been considering rolling out your own, this tutorial showed <strong>how to build a simple contact form<\/strong>.<br \/>\n[emaillocker]<br \/>\nHere is the link to the <a href=\"https:\/\/www.dropbox.com\/scl\/fi\/27jekmaifjz23w67ddcv8\/designmodo-contact-form-plugin.zip?rlkey=hiv3mho2a4jw51ysm8hf42hgb&amp;e=1&amp;dl=0\">designmodo contact-form plugin<\/a> just in-case you want to use in your WordPress site and also study the code to learn how it works.<br \/>\n[\/emaillocker]<br \/>\nIf you have any questions, or suggestions for code improvement, let me know in the comments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One feature common to almost every website in the world is the contact form. It can be used to collect feedback, complaints or useful information from website clients and users. A typical contact form consists of the following fields &#8211; sender name, sender email address, email subject and the message. In this tutorial, you will [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":117243,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-117235","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress"],"blocksy_meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Build a WordPress Contact Form - WordPress Guides<\/title>\n<meta name=\"description\" content=\"One feature common with virtually all website in today&#039;s world is the WordPress contact form, used in receiving feedback, complaints or useful information from website clients and users.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Build a WordPress Contact Form - WordPress Guides\" \/>\n<meta property=\"og:description\" content=\"One feature common with virtually all website in today&#039;s world is the WordPress contact form, used in receiving feedback, complaints or useful information from website clients and users.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/\" \/>\n<meta property=\"og:site_name\" content=\"WordPress Guides\" \/>\n<meta property=\"article:published_time\" content=\"2014-06-23T08:54:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-11T10:13:35+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/strictthemes.com\/articles\/#\/schema\/person\/0494d35a2138fb6ca85de8d8c107cea3\"},\"headline\":\"How To Build a WordPress Contact Form\",\"datePublished\":\"2014-06-23T08:54:01+00:00\",\"dateModified\":\"2025-11-11T10:13:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/\"},\"wordCount\":1357,\"commentCount\":18,\"publisher\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/#organization\"},\"image\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/#primaryimage\"},\"thumbnailUrl\":\"\",\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/\",\"url\":\"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/\",\"name\":\"How To Build a WordPress Contact Form - WordPress Guides\",\"isPartOf\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/#primaryimage\"},\"thumbnailUrl\":\"\",\"datePublished\":\"2014-06-23T08:54:01+00:00\",\"dateModified\":\"2025-11-11T10:13:35+00:00\",\"description\":\"One feature common with virtually all website in today's world is the WordPress contact form, used in receiving feedback, complaints or useful information from website clients and users.\",\"breadcrumb\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/#primaryimage\",\"url\":\"\",\"contentUrl\":\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/strictthemes.com\/articles\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Build a WordPress Contact Form\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/strictthemes.com\/articles\/#website\",\"url\":\"https:\/\/strictthemes.com\/articles\/\",\"name\":\"WordPress Guides\",\"description\":\"Create WordPress websites for begginers.\",\"publisher\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/strictthemes.com\/articles\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/strictthemes.com\/articles\/#organization\",\"name\":\"WordPress Guides\",\"url\":\"https:\/\/strictthemes.com\/articles\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/strictthemes.com\/articles\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/strictthemes.com\/articles\/wp-content\/uploads\/2021\/02\/logo.png\",\"contentUrl\":\"https:\/\/strictthemes.com\/articles\/wp-content\/uploads\/2021\/02\/logo.png\",\"width\":500,\"height\":500,\"caption\":\"WordPress Guides\"},\"image\":{\"@id\":\"https:\/\/strictthemes.com\/articles\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/strictthemes.com\/articles\/#\/schema\/person\/0494d35a2138fb6ca85de8d8c107cea3\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/0f3e4f16181fb8c4f52d8ce92b721be0a10c6988bdb5a145b784cde45f5ef679?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0f3e4f16181fb8c4f52d8ce92b721be0a10c6988bdb5a145b784cde45f5ef679?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0f3e4f16181fb8c4f52d8ce92b721be0a10c6988bdb5a145b784cde45f5ef679?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/strictthemes.com\/articles\"],\"url\":\"https:\/\/strictthemes.com\/articles\/author\/andrian\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Build a WordPress Contact Form - WordPress Guides","description":"One feature common with virtually all website in today's world is the WordPress contact form, used in receiving feedback, complaints or useful information from website clients and users.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/","og_locale":"en_US","og_type":"article","og_title":"How To Build a WordPress Contact Form - WordPress Guides","og_description":"One feature common with virtually all website in today's world is the WordPress contact form, used in receiving feedback, complaints or useful information from website clients and users.","og_url":"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/","og_site_name":"WordPress Guides","article_published_time":"2014-06-23T08:54:01+00:00","article_modified_time":"2025-11-11T10:13:35+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/#article","isPartOf":{"@id":"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/"},"author":{"name":"admin","@id":"https:\/\/strictthemes.com\/articles\/#\/schema\/person\/0494d35a2138fb6ca85de8d8c107cea3"},"headline":"How To Build a WordPress Contact Form","datePublished":"2014-06-23T08:54:01+00:00","dateModified":"2025-11-11T10:13:35+00:00","mainEntityOfPage":{"@id":"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/"},"wordCount":1357,"commentCount":18,"publisher":{"@id":"https:\/\/strictthemes.com\/articles\/#organization"},"image":{"@id":"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/#primaryimage"},"thumbnailUrl":"","articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/","url":"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/","name":"How To Build a WordPress Contact Form - WordPress Guides","isPartOf":{"@id":"https:\/\/strictthemes.com\/articles\/#website"},"primaryImageOfPage":{"@id":"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/#primaryimage"},"image":{"@id":"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/#primaryimage"},"thumbnailUrl":"","datePublished":"2014-06-23T08:54:01+00:00","dateModified":"2025-11-11T10:13:35+00:00","description":"One feature common with virtually all website in today's world is the WordPress contact form, used in receiving feedback, complaints or useful information from website clients and users.","breadcrumb":{"@id":"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/strictthemes.com\/articles\/wordpress-contact-form\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/strictthemes.com\/articles\/"},{"@type":"ListItem","position":2,"name":"How To Build a WordPress Contact Form"}]},{"@type":"WebSite","@id":"https:\/\/strictthemes.com\/articles\/#website","url":"https:\/\/strictthemes.com\/articles\/","name":"WordPress Guides","description":"Create WordPress websites for begginers.","publisher":{"@id":"https:\/\/strictthemes.com\/articles\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/strictthemes.com\/articles\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/strictthemes.com\/articles\/#organization","name":"WordPress Guides","url":"https:\/\/strictthemes.com\/articles\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/strictthemes.com\/articles\/#\/schema\/logo\/image\/","url":"https:\/\/strictthemes.com\/articles\/wp-content\/uploads\/2021\/02\/logo.png","contentUrl":"https:\/\/strictthemes.com\/articles\/wp-content\/uploads\/2021\/02\/logo.png","width":500,"height":500,"caption":"WordPress Guides"},"image":{"@id":"https:\/\/strictthemes.com\/articles\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/strictthemes.com\/articles\/#\/schema\/person\/0494d35a2138fb6ca85de8d8c107cea3","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0f3e4f16181fb8c4f52d8ce92b721be0a10c6988bdb5a145b784cde45f5ef679?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0f3e4f16181fb8c4f52d8ce92b721be0a10c6988bdb5a145b784cde45f5ef679?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0f3e4f16181fb8c4f52d8ce92b721be0a10c6988bdb5a145b784cde45f5ef679?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/strictthemes.com\/articles"],"url":"https:\/\/strictthemes.com\/articles\/author\/andrian\/"}]}},"_links":{"self":[{"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/posts\/117235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/comments?post=117235"}],"version-history":[{"count":2,"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/posts\/117235\/revisions"}],"predecessor-version":[{"id":690253,"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/posts\/117235\/revisions\/690253"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/strictthemes.com\/articles\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/media?parent=117235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/categories?post=117235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/strictthemes.com\/articles\/wp-json\/wp\/v2\/tags?post=117235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}