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”

Yamile Yemoonyah, thanks for the reporting. What kind of host/server are you using? Do you have the same problems with other plugins as well? Are you using the latest WordPress?

If there are other users facing the same problems, please let me know.

Hi again, Miyoshi

I took your advice of November 12 and upgraded to WP2.7, then tried to auto-upgrade this plugin again…
Instead of hanging after unpacking, I now get the following:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 1204450 bytes) in /home/beardedg/public_html/wp-includes/http.php on line 1032

The previous version (1.8.0.4) is still working fine.

beardedgit, I’m still not sure but it seems that the cause of this issue is insufficient rest memory size. If you can configure your PHP settings, increasing the ‘allowed memory size’ to 64MB might solve it. Or if there are unnecessary heavy PHP application running and wasting the memory, stopping it is the best solution I think.

after upgrading to WP 4.7 i get this error in place of where the form should be:

[contact-form 404 "Not Found"]

i’ve tried updating permalinks, creating a new form and disabling/enabling plugin. no luck.

Problem sorted!

I deactivated all plugins except this one and Akismet, tried to auto-update this one and it worked first time. After reactivation of all plugins, all seems well.

Actually, I don’t think it’s an IIS issue. But the contact form is posting on my localhost but not on live. Are there any settings I have to change?
When I click submit, the page reloads but nothing happens!

Actually it may have nothing to do with IIS. The problem I’m having is that the form won’t post on my live site but it will on my localhost. Any ideas?

It’s not because of IIS. But it doesn’t work on my live site and it does work on my localhost. Why would this be?

sorry about all those messages, I couldn’t see any of my posts (until i realised i hadn’t cleared my cache!)
Basically, the problem is that my server is running IIS. This means that I have to write a 404-handler file which then breaks the form. It’s an issue with pretty permalinks not your plugin. I now have it working but the links aren’t very user-friendly now :(
Thanks anyway!

hi

Your contact form working nice. Thank you for that.

One question.

Is it possible to include jquery / javascript only for a particular page? I am using this contact only for my contact page. But scripts includes all the pages. how we can remove the scripts from other pages. I don’t want to include all scripts for all pages.

Thanks

hi dear
i hope you fine
i want to know that how could i call Upload Function on my email
i generate it on the form
but id doesn’t appear on my email
please inform me bye email
i use the same structure for calling others fields
but i have trouble in calling upload on my email!!!
also please inform me bye email

i installed your plugin its very nice i like it but i am having one problem, when someone send me email i don’t receive it, can you please tell me how to fix it?

Thanks for this plugin – it seems to work just fine EXCEPT that I cannt work out how to get the whole form sent to my email when it is submitted.

At the moment I just get the person’s email address and any comments they may have left – but nothing from the form. I must have missed something!

If you can advise i would appreciate it and Happy Christmas!

hello,

how i can add a new line to upload a photo or more photo and somebody send something with this form?

Thanks

i have the right code inserted on my page (copy/pasted from the contact form 7 admin page) – still getting the 404 error – what else oculd it be?

[…] Contact Form 7 日本語環境で使えるメールフォームで、自由に項目を設定できる。 導入も簡単で、非常に優れたプラグイン。 なんと言っても魅力はAkismetを利用してスパムをはじけること。 しかし、相性の悪いプラグインやブログパーツが多数存在するのが難点。 詳しくは「Contact Form 7 覚え書き」で書いた。 […]

Thanks for the plugin.

It was working great until recently. I too am getting the elusive red box on all of my submitted contact forms. I read all I could about how to change the php mailer but still could not get it to work. I also tried downloading the pluging add on you suggested.

I am running wordpress 2.7

Any ideas?

Daniel Riem, do you have other mails like comment notifications? You should make it clear first that this is a problem of the plugin, WordPress or your using hosting server. If it had been working, there must be a trigger of the change.

Thanks for the ideas…

I do get comment notifications. So I know my mail is working.

Its really weird because everything was working about a month ago and I havent made any changes.

Any other thoughts?

This is a great plugin, I am currently using it on my domains! :) I just have one main question…

Is is possible to show the IP address of the person who sent the form?

Please get back to me as soon as possbile. I have even tried asking on the WordPress.com forum but so far no responses.

Hi,
I get the IE issue (charging in ajax and never confirm sending).
I had 5 validation errors in my page: I spent some hours to solve that in my theme, but your plug-in still didn’t work.
Firefox was always ok and IE go well only from the page where I placed your CF, (but not if placed in a post).
I wanted the CF in the start page of my WP, so I tried to change the start page with the module using my WP admin panel.
Surprise! CF stopped to work again!
I re-write a new post with the module and I noticed that it worked properly only in post’s detail page but not in the last post page list (the default start page in WP).
My conclusions: maybe CF7 take the redirect variable in the url. Blank variable could be a problem for ie and not for other browser.
Do you thing is there any way to fix that?
THANKS a lot, above all for your useful plug-in.
bye

Hello, I have the exact same problem as Daniel Riem. I am also with Bluehost.

This plugin has been working fine for weeks, then out of the blue, I started getting the red box on every form.

Any recommendations would be great. I’ll post back if I figure anything out.

(I’m on WP 2.7 and the newest CF7)

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