WordPress Contact Form with Spam Protection

UPDATE: I’ve discontinued development of this plugin. Instead, I would highly recommend Gravity Forms from RocketGenius for a very robust form integration with WordPress!

Originally written by Ryan Duff (his site is no longer active), this was a great contact form that could be added to your post or page. I’ve significantly modified the plugin and added quite a few features:

Features:

  1. Tableless and CSS Driven with the styling available through the admin panel.
  2. Compatible with WordPress 1.5 and up!
  3. Ability to built a list drop-down of subjects by typing in your subjects delimited by a pipe character (Option A | Option B | Option C)
  4. Secured the form at the advise of a reader to ensure that it was not cross-site scripting capable.
  5. Updated the email reply address to actually be the email and name that filled out the form. That allows you to simply reply to the email when it arrives in order to respond.
  6. Formatted the form for easy placement in any page.
  7. Add the challenge question and answer capability. Now with optional case sensitivity!

Upgrading to this Version:

If you have this plugin installed already, write over the files. It won’t break anything. Be sure to modify your code on your page, though.

The old code was a comment . The new code is %%wpcontactform%%.

The default Challenge Question is 2 +2 = and the default correct answer is 4 (of course!).

Installation:

If you haven’t installed this plugin before:

  1. Copy the plugin (the entire wp-contact-form folder) to your plugin directory.
  2. Enable the plugin.
  3. Go to Options > and fill in the information. Change the challenge question and answer if you’d like.
  4. You can built a list drop-down of subjects by typing in your subjects delimited by a pipe character (Option A | Option B | Option C)
  5. The easiest option is to build yourself a Contact Page and insert the following in the content of the page.

    %%wpcontactform%%

  6. If you’d like to insert the code into your template, enter the following code:

  7. My recommendation is to build a page template in your theme and then assign it to your contact page.

Known Issue:

When utilizing the substitution string method to insert the form into the page content, WordPress filters add a linebreak between the label and form elements. It’s quite aggravating, so my recommendation would be to add it using a Page Template instead.

Screenshot:

WordPress Contact Form Version 3

Version:

Current Version: 3.2.1

Download:

Download the WordPress Contact Form with Spam Protection

History:

3.2.1 Fixed a bug with the permissions issue with WordPress 2.8.1
3.2.0 Updated permissions on Admin call to correct problem with permissions error on WordPress 2.8.1
3.1.8 Removed the colon from the subject by request
3.1.7 Added options for the number of columns and rows
3.1.6 Added a Spanish translation by Francisco.
3.1.5 Corrected an issue with the Wordwrapping functionality that was affecting the message being sent. Thanks to Francisco for the find!
3.1.4 Added stripslashes so apostrophes don’t come through on the email message with a slash.
3.1.3 Updated the language files and did some cleanup.
3.1.2 Ade at Formspring bailed me out again and found the issue with the strpos delimiter error!
3.1.1 Corrected some additional CSS issues as well as updated a function that’s been resulting in a strpos delimiter error.
3.1.0 We’re multi-lingual! Thanks to Sebastian Kraft for adding the first translation file!
3.0.2 Default the email address to the current user when the plugin is loaded or when the field is left unpopulated.
3.0.1 Fixed an issue with the reply email address not being set properly in the mailing function
3.0.0 Tableless and CSS driven with the styling available to change in the Admininstration
2.0.7 Uses wp_mail() and modifies it to route mail via SMTP – by Callum Macdonald
2.0.6 Added field tabindexes, removed html comments
2.0.5 Did some code cleanup
2.0.4 Added a check box where the person can copy themselves on the submission
2.0.3 Added cols to the textarea for XHTML compliance
2.0.2 Fixed an issue where the options page was not properly submitting changes in Internet Explorer
2.0.1 Fixed an issue with the list box not populating correctly with the full array of subjects
2.0.0 Rewrote major portions of the plugin and added the ability to have a multi-select list
1.9.0 Secured the posted data to eliminate the opportunity for cross-site scripting
1.8.0 Added option for client subject line concatenated to your default subject line
1.7.0 Added option for case sensitivity in the evaluation of the response
1.6.0 Ryan’s site has seem to have disappeared so I’m going to add this to my project page