PurabTech is technical blog for Programmer and Coders
how to create contact us page without plugin
Every wordpress site is need to contact us page for there website or blog. All the people use the wordpress plugin for creating the contact us page. When you install the wordpress plugin that will install some extra code to your wordpress site. After using wordpress plugin you need some customization in that plugin due to UI. You need R&D time and development time. Code for contact us page without plugin.
contact us page without plugin
In this article I will show how you can create the contact us page with out any wordpress plugin. Using following code you can create the contact us form very easily.
First create contact-us.php page in your wordpress theme folder and put following code in that file.
[viral-lock message=”Solution code is Hidden! It’s Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.”]
$error.= "<p>Please enter a valid email address</p>";
12
}
13
if(!trim($_POST[your_message])){
14
$error.= "<p>Please enter a message</p>";
15
}
16
if(!trim($_POST[your_subject])){
17
$error.= "<p>Please enter a message</p>";
18
}
19
if(!$error){
20
$email= wp_mail(get_option("admin_email"),trim($_POST[your_name])." sent you a message from ".get_option("blogname"),stripslashes(trim($_POST[your_message])),"From: ".trim($_POST[your_name])." <".trim($_POST[your_email]).">\r\nReply-To:".trim($_POST[your_email]));
Then go to your wordpress admin panel. Create page called contact us. In Right side panel you will find the “page attribute” section. From template drop down choose the Contact Us option. and create the contact us page.
contact us page without plugin
WordPress uses the wp_mail() function for sending the email. all wordpress plugin also use the wp_mail() function for sending the email.
If you are having issues with sending the email with this function then you should use the different SMTP mail server for sending mail.
For sending email through SMTP in detail you should check the following article.
With this code you can write your own CSS for styling the contact form as per your wordpress theme. If you are having any issues or question about this script then please write to me.
All wordpress websites has requirement to add the contact form in there website. We always searching for wordpress contact form code, wordpress simple contact form, wordpress contact form with captcha, wordpress default contact form, wordpress contact form without plugin, wordpress contact form not sending email, wordpress custom contact form, best wordpress contact form solution. We can easily add the contact form without using any wordpress plugin very easily. You can use the my code snippet in your wordpress theme and you will be able to add the wordpress contact form.
Thanks for sharing this article. But it would have been great if you could have shared how exactly the “Contact Us” page will look. And will i need to write something also while i am creating the page ?
Great tips to create a contact us page without using any plugin, I just need to add one thing here , try to add your email as image so that you did not start getting spam email.
nice post.. i was searching for it. i have using plugins they rally overload our site. thanxx
Great stuff. Thanks for this!
The contact form doesnt send the email to the desired email address of the blog
Thanks for sharing this article. But it would have been great if you could have shared how exactly the “Contact Us” page will look. And will i need to write something also while i am creating the page ?
Didn’t you mean to write label instead of lebel in the code?
Great tips to create a contact us page without using any plugin, I just need to add one thing here , try to add your email as image so that you did not start getting spam email.
it really help you to protect your email address.
Sure..I will update code