Fall Sale! Code FALL2024 takes 25% OFF our Pro Plugins & Books »
Web Dev + WordPress + Security

WordPress Plugin: Simple Basic Contact Form

[ WordPress Plugin: Simple Basic Contact Form ] Simple Basic Contact Form is a clean, secure, plug-n-play contact form for WordPress. Minimal yet flexible, SBCF delivers clean code, solid performance, and ease of use. No frills, no gimmicks, just a straight-up contact form that’s easy to set up and style for any theme.

For a contact form with more options and features, check out Contact Coldform, or continue reading to learn more about Simple Basic Contact Form. Either way, thanks for visiting.

Update!

As explained here, I no longer own or develop Simple Basic Contact Form. Since selling the SBCF plugin, I have developed a much better, faster, more awesome contact-form plugin. Check out Contact Form X at the WP Plugin Directory. I use Contact Form X for my own contact form here at Perishable Press. It’s all Ajax-powered and super easy to use. Check it out!</update>

Overview

Here are some of my favorite features of Simple Basic Contact Form:

  • Plug-n-play – display the contact form anywhere
  • Sweet emails – SBCF sends descriptive, well-formatted messages
  • Safe and secure – SBCF blocks automated spam and malicious content
  • Ultra-clean code – SBCF is lightweight, standards-compliant, and secure
  • Fully customizable – SBCF is easy to configure and customize

Here is a screenshot showing the form displayed on WP’s default Twenty Sixteen theme:

[ WordPress Plugin: Simple Basic Contact Form ]
SBCF contact form (view more screenshots)

Features

Here are some of the main features for Simple Basic Contact Form:

  • Slick, toggling-panel Settings Page makes it easy to customize
  • Style the form via the Settings Page using your own custom CSS
  • Provides template tag to display SBCF anywhere in your theme
  • Provides shortcode to display SBCF on any post or page
  • Displays customizable confirmation message to the sender

And even more features:

  • Works perfectly without JavaScript.
  • Option to reset default settings
  • Options to customize many aspects of the form
  • Options to customize success, error, and spam messages
  • Option to enable and disable CSS styles
  • Email message includes IP, host, agent, and other user details
  • Customizable form-field captions, error messages, and success message

Here is a screenshot showing the SBCF settings page:

[ WordPress Plugin: Simple Basic Contact Form ]
SBCF Settings page (view more screenshots)

Anti-spam & Security

  • Captcha – includes challenge question/answer
  • Firewall – protects against bad bots and malicious input
  • User-friendly – error messages help users complete required fields

Clean Codes

  • Crisp, clean markup: source code properly formatted and 100% valid
  • Crystal clear emails: delivers well-formatted, plain-text email messages
  • Better performance: CSS loads only where contact form is displayed

Installation & Usage

Typical plugin install: upload, activate, and customize in the WP Admin:

  1. Unzip and upload the plugin to your “plugins” folder and activate
  2. Use the shortcode to display SBCF on any post or page, or:
  3. Use the template tag to display the SBCF anywhere in your theme
  4. Visit SBCF Settings to configure your options and for more infos

Shortcode

[simple_contact_form]

Template tag

<?php simple_contact_form(); ?>

Screenshots

Here are some screenshots of Simple Basic Contact Form running with WP’s default theme, Twenty Eleven (using default plugin options):

Markup & Styles

Here is the HTML markup used to create the contact form (default settings):

<div id="simple-contact-form" class="scf">
	<form action="http://example.com/contact/" method="post">
		<fieldset class="scf-name">
			<label for="scf_name">Your Name</label>
			<input name="scf_name" id="scf_name" type="text" size="33" maxlength="99" value="" placeholder="Your Name" />
		</fieldset>
		<fieldset class="scf-email">
			<label for="scf_email">Your Email</label>
			<input name="scf_email" id="scf_email" type="text" size="33" maxlength="99" value="" placeholder="Your Email" />
		</fieldset>
		<fieldset class="scf-subject">
			<label for="scf_subject">Email Subject</label>
			<input name="scf_subject" id="scf_subject" type="text" size="33" maxlength="99" value="" placeholder="Email Subject" />
		</fieldset>
		<fieldset class="scf-response">
			<label for="scf_response">1 + 1 =</label>
			<input name="scf_response" id="scf_response" type="text" size="33" maxlength="99" value="" placeholder="Correct Response" />
		</fieldset>
		<fieldset class="scf-message">
			<label for="scf_message">Your Message</label>
			<textarea name="scf_message" id="scf_message" cols="33" rows="7" placeholder="Your Message"></textarea>
		</fieldset>
		<div class="scf-submit">
			<input type="submit" id="scf-button" value="Send email">
			<input type="hidden" id="scf-key" name="scf-key" value="process">
			<input type="hidden" id="scf-nonce" name="scf-nonce" value="1234567890" />
		</div>
	</form>
</div>

And here is a complete set of CSS hooks for styling the form (visit the settings page to add custom styles):

/* contact form */

div#simple-contact-form {}
div#simple-contact-form form {}
#simple-contact-form fieldset {}
#simple-contact-form label {}
#simple-contact-form input {}
#simple-contact-form textarea {}

#simple-contact-form fieldset input {} /* excludes submit button */
#simple-contact-form div.scf-submit input {} /* submit button */

#simple-contact-form input:focus,
#simple-contact-form textarea:focus {}

fieldset.scf-name {}
fieldset.scf-email {}
fieldset.scf-subject {}
fieldset.scf-response {}
fieldset.scf-message {}

div.scf-submit {}

input#scf_name {}
input#scf_email {}
input#scf_subject {}
input#scf_response {}
input#scf_message {}
input#scf-button {}

/* successful result */

div#scf_success {}
div#scf_success pre {}
p.scf_success {}
p.scf_carbon {} 
p.scf_reset {}

/* error */

p.scf_spam {}
p.scf_error {}
input.scf_error {}
textarea.scf_error {}

Download

As explained at the beginning of this post, I no longer own or help develop Simple Basic Contact Form. The plugin is in good hands, but I built a better, faster, more awesome contact-form plugin. Check it out and download via the WP Plugin Directory:

About the Author
Jeff Starr = Web Developer. Book Author. Secretly Important.
SAC Pro: Unlimited chats.

66 responses to “WordPress Plugin: Simple Basic Contact Form”

  1. Thank you for the update with the optional captha and carbon copies!

  2. Nice job, as usual! Plugin is ready for translation, but I can’t localize it :(

    It seems that you miss the load_plugin_textdomain() hook for i18n.

    Should I fix it manually or just wait for your updates?

  3. Where is your donate button?

    • Jeff Starr 2013/01/10 6:21 pm

      In the footer of each plugin there’s an “Updates & Info” panel that includes ways to show support, donate, etc.

  4. Hi Jeff,
    In a prior post I wrote:I have been wrestling with the Contact Form 7 plugin. It is giving me fits in that it reports the form data has successfully been submitted but the email never arrives.”

    I have installed smbcf and have the same issues. the form reports success but I never get an email.

    Can you suggest where I might try trouble shooting this?

    Since your form and contact form 7 seem to be acting similar is it likely something with my hosting account? I am on a TMZvps with WHM and Cpanel.

    Happy trails, Mike Foate

    • Jeff Starr 2013/01/20 1:35 pm

      Hi Mike, one thing that may help.. locate both instances of “wp_mail” and change each of them to “mail”. It’s worked for a couple of other folks having the same issue.

  5. cowboy Mike 2013/01/20 1:41 pm

    Hi Jeff,
    Thank you for the kind reply. I have set up a mailbox on the domain and have set the form to send email to it. That does work.

    I had been trying to have the form send email to an email box on another domain and that does not work. So either wp or my mailserver setup will not let the form send email to an outside domain.

    Does that make sense or is that a standard thing?
    Happy trails, Mike

    • Jeff Starr 2013/04/08 2:52 pm

      Hmm.. not sure, but using either mail or wp_mail should work to send email anywhere, unless there are restrictions in place on the server.

      I would ask your host about this, using more general terms so they can’t refuse to answer the question because it involves 3rd-party software or whatever.

      You just need to find out if there is any reason why PHP scripts would not be able to send mail to addresses on external domains.

      Good luck

  6. Great plugin, thanks for it.
    Just one suggestion to internationalize it a bit more, for the date instead of this:
    $date = date(“l, F jS, Y @ g:i a”, time() + $offset * 60 * 60);
    I would replace “date” with “date_i18n” so that the date is translated in the local language of the WP install.
    And I would replace “time() + $offset” with “strtotime(time())” so that there is no need any more for the time offset (moreover it will take care of day light saving time)

    • WordPress have built-in function for displaying time that takes into account timezone set in WP settings:
      $date = current_time(‘mysql’);

      P.S. Contact form’s $offset unfortunately does not work for me when I send a message and get to Success! screen. It just displays UTC. If I replace the var with the actual value, then it it does.

  7. Hi Jeff,
    Where would I begin to troubleshoot for the carbon copy to sender not working?

    Also I would like to donate…especially if we get the carbon copy to sender working…just kidding I will donate regardless. ;)
    Happy trails, Mike

  8. Hey, I’m also waiting for the translation updates with this contact form. I hope you will updates its sooner. Anyway I got some modification for now but not 100% working :).

  9. Works perfectly on my installation. I am using template tag to generate this contact form. Earlier using Contact form 7 but, found this one more simple.

  10. I love how the contact form looks, but I can’t seem to get mail to come through from it. I Followed the advice earlier in these comments and changed the ‘wp_mail’ code to ‘mail’ but still nothing comes through. Any help would be much appreciated as I really want to use this form. Thanks

  11. I copied your HTML markup code for the default settings from above and put them in my page. In the part of your code where you say

    <form action="https://perishablepress.com/contact/" method="post">

    What would I put for my site for my form action when I have my form on this page? http://janregan.com/contact3/

    Many thanks! ~ Steve
    Gainesville, Flordia USA

    • Jeff Starr 2013/04/03 6:30 pm

      The plugin should add the HTML, it’s included in the post to help with CSS styling.. but if you have other reasons for using it, the action attribute is set using <?php get_permalink(); ?>, as seen in the plugin file on line 278. :)

  12. p.s.:
    I have it working fine here at http://janregan.com/contact2/ with just the shortcode. But I couldn’t modify the send label nor align the button position, so that’s why I tried to copy your HTML markup code and make my modifications.

    • Jeff Starr 2013/04/03 6:33 pm

      Ah, that explains it.. I should mention that CSS for button-position and whatever else may be added via the plugin’s settings page. The send label can be done with a quick edit on line 293 (locate “Send email” in the file).

Comments are closed for this post. Something to add? Let me know.
Welcome
Perishable Press is operated by Jeff Starr, a professional web developer and book author with two decades of experience. Here you will find posts about web development, WordPress, security, and more »
WP Themes In Depth: Build and sell awesome WordPress themes.
Thoughts
I disabled AI in Google search results. It was making me lazy.
Went out walking today and soaked up some sunshine. It felt good.
I have an original box/packaging for 2010 iMac if anyone wants it free let me know.
Always ask AI to cite its sources. Also: “The Web” is not a valid answer.
All free plugins updated and ready for WP 6.6 dropping next week. Pro plugin updates in the works also complete :)
99% of video thumbnail/previews are pure cringe. Goofy faces = Clickbait.
RIP ICQ
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.