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”

Hello,
is there a way to see the demo of the page so that i can see it before insatllying.
Actually i need some plugin which can create multiple forms and the results of those forms should be send to different email addresses. and if a html autoreply can be snd to the sender it would be great. is it possible to do with these.

Hi Miyoshi,

First off – great plugin. Got me a contact page up in just seconds!

I am however having an issue with Akismet filtering not working. I followed the directions and have [text* your-name akismet:author] for the author and [email* your-email akismet:author_email] for the email. I then saved and tried the viagra-test-123 test (the test page is at http://www.yash-patel.com/yfactor/contact). However, it still sends email. I also read through the comments here and saw to check if Akismet is working, which it is (I tried to create a new comment with viarga-test-123, and it was caught in the spam filter). So, Akismet is working, but I can’t get it to filter things from the contact form. What am I missing?

Thanks,
Yash.

Thanks for this very useful plugin. Ever since i have started using this plugin, it has increased my regular readers and also helped me keeping track of them.

There is no demo i could find which made me expriment on my own wordpress installation. Demo page would definitely be much of help.

Thanks again

I really wish you would publish the change log with release updates, if not on the WordPress plug-in page, then somewhere on this site. I hate having to download, unzip, and run my own file diffs to find out what has changed. It’s really aggravating.

Hello,
i would change background color for the form.
It’s possible?
What file I must edit?

Thank you.
Serena

div.wpcf7-response-output {
margin: 2em 0.5em 1em;
padding: 0.2em 1em;
}

last command missing for margin in stylesheet.css

corrected stylesheet:
margin: 2em 0.5em 1em 0;

div.wpcf7-response-output {
margin: 2em 0.5em 1em;
padding: 0.2em 1em;
}

last command missing for margin in stylesheet.css

corrected stylesheet:
margin: 2em 0.5em 1em 0;

great and slick plugin!!

Just started my new blog. Your contact form plugin was just what I was looking for. Easy to install, and so far, it seems to be working great! Thank You! (only problem I’ve had was scrolling to the bottom of this page to leave my reply…took very long time!) :)

HI,

very nice little contact form * how can I influence then length of the colour boxes. they are much to long in my case because I put in short replystrings –

Thanks for answering !

Hi,

How can I add a page to display after the form is submitted? A redirect or thank you page would be nice. I would like to have a visitor submit the form and then be directed to a page.

Hi Myoshi,

I have a question. I inserted your form and it works great. Thanks first. But I don’t reveice any emails… I checked my server and anything. Can I change the mail adress where the mails get to? Because I want to sent them to a special adress like kontakt@…de

Is there a solution? My page i inserted is: http://www.mkbzwei.de/wordpress/?page_id=23

miyoshi-dono,

thanks for the great plugin! i’ve used and tested it successfully using the simple contact form here:
http://photoworldmanila.com/wordpress/fppf/contact-us/
i send a test message, the page says message sent, and indeed i do receive it.

however, in my Registration Form page, http://photoworldmanila.com/wordpress/fppf/registration-form/ where i use a few more options like radio buttons and drop-downs for choices plus some other text areas, it also confirms that the message has been sent, but when i check for the message in the assigned email address, what i get is just [your-subject], [your-name] and no other details. how do is do this successfully? pls help!

thanks.

I can’t figure out where to manage the contact form (i have 2.7.1 wp) I try under tools but there is nothing… But maybe it changes because mine is in danish.. In tools there is only import and export..

Its just a great plugin. Thank you for your contribution.

I have a small problem. My website link is http://www.zaheerspeaks.com/contact-zaheer-khan/ and the fields borders are not visible in Firefox. I am using Firefox 3.0.0.6. It works great in IE.

Please guide. Also if possible tell me how can I validate my website from w3.org. As I tried and it failed. I am newbie with this stuff. So, any help will be greatly appreciated.

Thanking you in anticipation.

Hi. First off, I love your plug-in. It is really wonderful.

I would like to have the input fields run flush on top of each other. Right now, they are slightly off alignment from one to the next. I read your earlier comment to Dominic:

“You can customize it from the stylesheet in the theme you’re using or from contact-form-7/stylesheet.css”

I am confused. My theme’s (Tropicala) stylesheet has no mention of Contact Form 7 and the contact-form-7/stylesheet.css is not listed in my WordPress editor.

Please help.

Thanks.

This is a great plugin. Only problem is that the captchas are not accessible. How are blind people using screenreaders supposed to use the form if they can’t see the image? The alt text for the image to be the captcha text, and not just “captcha”

Can you re-order the message that appears when you submit a form? Right now when you submit a form it appears after the form. Can I change some code to make it appear before the form? I have a very long form and I am getting many redundant submits.

Thanks

Hi there

My hosting service have recently upgraded their servers and your plugin will no longer send mail – you get a ‘thank you’ meassage but do not receive the mail. They have said “You will need to configure your scripts in accordance with our hosting platform to be able to sucessfully send emails from your site.” pointed me towards this item in their support pages:

Use the PHP mail function and set the mail from using the following line of code – replacing $email_from with the correct domain name.

* ini_set(“sendmail_from”, ” $email_from “);

You need to add a fifth “-f” parameter to the sendmail function. This will set the name of the from address.

* mail($email_to, $email_subject, $email_message, $headers, ‘-f’.$email_from);

This is covered in the article EXAMPLE: ‘Form to Mail’ script using PHP.

can you help?

regards

Dean

HI, the new version of the contact form doesn’t funtion correctly.

All the email to me come as FROM me. The email & name of the sender are not there.

I also noticed that no matter what changes you make to the email details section to customize the email do not work. I imagine this is why the FROM is missing, as it doesn’t pick up the form variable names properly.

I use Contact 7 on my site, http://www.mcaddengroup.com. I want to have the input fields line up in a perfect column, aligned right on top of one another. When I work with text in WordPress you can select the button “align full” to accomplish that look. I want to do that with my three input fields. Right now, they are slightly off alignment from one to the next.

Any ideas?

This is a great plugin! One feature suggestion; it would be nice if we could set it to only include the stylesheet and javascript in the header of particular pages. That way it doesn’t load them on all pages, when most sites only have one page that will require it.

Same problem here as Paul.
All the mails that come to me as FROM me.
First I thought it was because I was still logged in to WordPress. So I logged out, cleared cache even, but still the same.

Strangely enough, last Wednesday I didn’t have this problem yet, while I’m not able to remember if I’ve changed something meanwhile…

well, it sure would be nice to hear fromt ehdeveloper on this problem. As it stands, the plugin doesn’t work. I can’t respond to anyone who emails me from my form because the email address isn’t recorded.

New version:Delete form –>
Fatal error: Cannot use string offset as an array in /home/…./public_html/blog/wp-content/plugins/contact-form-7/wp-contact-form-7.php on line 454

Forget it!

A) I don’t see my comment from the other night about the plugin not working. There was no profanity so no reason to moderate

B) I found another plugin. Can’t wait long for answer to problem.

Thanks for the great plug-in. How do I get the validation messages to appear in Japanese?

Thanks

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