Categories
WordPress Plugins

Contact Form 7

This post is no longer updated. Move to Contact Form 7 official site.


Download | Plugin Homepage | FAQ | Support Forum

(日本語の説明はこちら)

Summary

screenshot

Just another contact form plugin. Simple but flexible.

  • Supports multiple contact forms.
  • You can customize form and mail contents with simple markup.
  • AJAX submitting with jQuery Form Plugin.
  • Spam filtering with Akismet.
  • Bot prevention with CAPTCHA.

Download and Install

Download the latest release from WordPress.org plugin directory.

  1. Upload whole contact-form-7 folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

Usage

  1. Open admin page [Options] – [Contact Form 7] [Manage] – [Contact Form 7].

    Update: If you are using WordPress 2.7 or greater, you can find the admin page under [Tools] – [Contact Form 7].

  2. Edit default “Contact form 1” or add new and save it.
  3. Copy [contact-form ...] code and paste it into the content of any posts you need the contact form.

FAQ

See Contact Form 7 FAQ

How to customize form and mail contents

You can use “tags” in several fields. Contact Form 7’s “tag” is formed string enclosed in square brackets [].

A tag used in form content is replaced by HTML form control element like <input> or <textarea>.

A tag used in mail template is replaced by user input of element with the same name.

wpcf7-desc

In this picture, a tag [textarea your-message ...] inserted in form content is replaced by <textarea> tag with name="your-message" attribute.

When a visitor input into this <textarea> field and submit, Contact Form 7 generates a mail based on mail template. Since message body field has [your-message] tag, this tag replaced by the user input message.

Tags in form content

You can use the following types of tags in form content.

Type Replaced by Validated as
text <input type="text" /> Any text
text* <input type="text" /> Any text / Required
email <input type="text" /> Email address
email* <input type="text" /> Email address / Required
textarea <textarea> </textarea> Any text
textarea* <textarea> </textarea> Any text / Required
select <select> </select>
select+ <select> </select>
checkbox <input type="checkbox" /> ...
checkbox+ <input type="checkbox" /> ...
radio <input type="radio" /> ...
captchac <img /> CAPTCHA
See How to use CAPTCHA
captchar <input type="text" />
submit <input type="submit" />

The syntax of tag is not so easy. You can use Generate Tag menu under Form textarea to make a tag you need.

I show you some examples of tags.

  • [text your-name 40/100 "John Smith"]

    This tag is replaced with:
    <input type="text" name="your-name" size="40" maxlength="100" value="John Smith" />

  • [email* your-email 60/ id:email]

    <input type="text" name="your-email" id="email" size="60" />

  • [textarea your-message 80x15 "Write message here."]

    <textarea name="your-message" cols="80" rows="15">Write message here.</textarea>

  • [select your-country "China" "India" "other"]
    <select name="your-country">
      <option value="China">China</option>
      <option value="India">India</option>
      <option value="other">other</option>
    </select>

I wrote about tag syntax.

How to use Akismet on Contact Form 7

1. You need Akismet plugin. If you have not activated it yet, activate it first.
2. Open Contact Form 7’s admin page and edit Form text area as:

  • Add akismet:author option to the tag of field which requires sender’s name.
    Example: [text* your-name akismet:author]
  • Add akismet:author_email option to the tag of field which requires sender’s email address.
    Example: [email* your-email akismet:author_email]
  • Add akismet:author_url option to the tag of field which requires sender’s URL.
    Example: [text your-url akismet:author_url]

Once you have activated the Akismet plugin and at least one of the akismet: options is set, Contact Form 7 will send all of a sender’s input as well as any other information related to input activity to the Akismet server. Akismet will then judge whether this input is likely to be spam.

When Akismet judges a message as spam, Contact Form 7 sends no mail and shows a response message with an orange border line (the third example in the picture below).

To make sure the spam filtering is working, send a message with “viagra-test-123” as the sender’s name. If the test is a success, the message will be judged as spam.

Changelog

0.9 (2007/04/30)
Initial release.
1.0 (2007/05/20)
Tag helper.
1.1 (2007/08/02)
File restructuring.
1.2 (2007/08/16)
jQuery Form Plugin introduced.
1.3 (2007/08/26)
New tag type: [select]
1.3.1 (2007/08/26)
Critical bug about JavaScript loading fixed.
1.3.2 (2007/09/03)
Bug fix around jQuery.
1.4 (2007/09/07)
Akismet spam filtering introduced.
1.4.1 (2007/09/11)
Add Spanish and Catalan translations.
1.4.2 (2007/09/13)
Add German translation.
1.4.3 (2007/09/15)
Add Polish translation.
1.4.4 (2007/09/17)
Add French translation.
1.5 (2007/10/07)
CAPTCHA introduced.
1.6 (2007/10/17)
Mail (2) and UI improvement for admin page.
1.6.1 (2007/10/27)
Sidebar widget support.
1.7 (2007/11/27)
New tag type: [select+], [checkbox], [checkbox+] and [radio]
1.7.1 (2007/12/06)
Made wpcf7 variable global. Polish translation updated.
1.7.2 (2007/12/13)
Bugfix. Czech translation added.
1.7.3 (2007/12/23)
New default: and label-first options added.
1.7.4 (2007/12/30)
select+ and checkbox+ tag types removed. multiple and exclusive options added.
1.7.5 (2008/01/26)
Two fixes and include_blank option.
1.7.6 (2008/03/02)
New acceptance tag added.

1,401 replies on “Contact Form 7”

(Usability) Is there an option to show the confirmation/error message at the top of the form ?

If people ha low resolutions never will see the bottom message and is better if is displayed at top because grab your attention.

Thank you

Hi there — I found this contact form to be quite useful, but I wanted something more secure (captcha has some downsides, plus it requires a bit more server configuration), so I added a security question feature (where the user is required to give the answer to a challenge question like “what color is the grass?”, which is obvious to humans but not email harvesters or spam-bots). I’ve modified the admin page to allow the user to specify the security question and answer, and added a couple tags to insert them into the form. I’d be happy to send you a copy of my revisions if you’re interested in incorporating it into the main release; just get in touch.

Hi there,

Is there any way to render html when it is used as default text in a textarea?

I’m wondering whether or not it’s possible to provide several formatted paragraphs of text which users can edit before submitting the form (without their having know html).

It might help to know what I’m trying to do which is to give people a sample letter to send to politicians, which they can edit if they want to.

CW

At last, a decent WP contact form plugin. Thank you, very much appreciated. I will be using it on a new site and will blog about it shortly to say thanks.

Hi,

I installed the plug-in which works great. However in Internet Explorer (IE) 6.0.2 the validation warnings are not displaying correctly.

All the validation box’s are hidden behind the input fields in the form ? So the user can’t read teh messages in the validation boxes.

I have looked at the code but not sure how to fix this – any thoughts?

It works fine in Firefox.

[…] For interaction and feedback with your readers this plugin offers a wide range of possibilities. You just select what type of control you want to add to your contact form and through a simple interface this is done without any programming knowledge. It is the plugin that powers Graphic Rating. Link:Contact Form 7 […]

Hi

I am using your contact forms plugin and it used to always work great but hasnt worked for months now and i finally realise why, its because i changed my website mail to gmail and it stopped working then, any idea how i can fix this?

Thanks
Martin

temporary solution to make form work with polyglot:

make TWO forms. one for one language, one for another..

I was trying to search function to place in polyglot hooks but unsuccessfully.. so i made two different forms.. :)

I have created the form, however whenever I recieve the email from the form, the message delivered to me does not show me the information filled out. Just their name. How do I fix this?

Thanks!

Martin, there must be a problem in your mail server or mail client (gmail). Ask your mail server admin if you need specific settings for sending mail to gmail address, and check your gmail spam filter.

[…] Contact Form 7 is an easily installed, moderately flexible contact form plugin. You generate tags on the option page, then paste those tags into the form area of the option page in the order you want them. You can style the forms in a couple of ways, either in the form area or by assigning class and id names in the tags when you create them. The second method gives you much more precise control over what your form looks like. Although like Formbuilder, some familiarity with CSS is required. […]

Hi,
I am a total novice but still managed to cobble together a decent looking website. See erinshipleyphotos.com
I love that Contact 7 is so easy to use, at least for the contact emails. But I am really having a problem getting file attachements to work. I am using the default tag [your-file] in the mail but still… no attachment. Also I can’t make heads or tails out of all the other tags or how to use them.. drop-downs, radio boxes, etc.
Isn’t there a coherent manual somewhere available for relative newbies like me?
Thanx

Hi. Nice plugin, been using it for a while, but on my new theme I’ve got a bit of a problem: how do I change the colour of the borders for the entry boxes?

Hi Takayuki.

I would like to pull the title of the post or page where I have added my contact form into the form itself either as a visible field or hidden, doesn’t matter which.

Is there a quick hack that would do this. Maybe by adding some code around the hidden fields in wp-contact-form-7.php ??

This is outside of my ability unfortunately.
Many thanks (for this and the plugin!!)
K

Keir, the plugin doesn’t have such features, and I think it’s very difficult to get it with ‘hack’, because Contact Form 7 uses filters. Why not separating forms into each posts?

Hi there. You’ve created a very nice plugin. I had a little problem so I’ve started to read the comments on this topic. I saw that another user has already asked you about it – I need a dropdown to select different emails for “Send to” option.

I know you’ve said it’s not possible yet, but still – I’ve got kind of custom solution. Here is the example:

[select* choose_email “Main office ” “Sales department “]

It should work, because the address field for emails may contain two kind of values – text and email, where the email should stay in . The problem is that you’re escaping the brekets. Do you think there is a way to fix this?

limit doesn’t work for me.. Files only not more then 2 mb beeing delivered to me.

That’s why I trying to use
[file obrazec-ozv limit:2000]
But if i use [file obrazec-ozv limit:2000] – files more then 3 mb are also trying to be sended.
If I use [file obrazec-ozv limit:2] files even like 10 kb are not send.

So how this feature works? Is it Kb or Mb? And how to limit it to 2 Mb to not required fild?

Initially, I had some trouble getting the captcha image to display. I just worked out that the problem was caused by having PHP ‘safe_mode’ turned on. Once I turned off safe_mode, the captcha image displayed correctly. Just a note for anyone else who may be having the same problem.

release notes / changelog are missing

when wordpress/ you ask me to update the plugin and i dont know whats changing i’M afraid of it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s