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”

I have been using Contact form 7 for a while and it has been great. But I just recently installed the MailPress plugin for WordPress, and now all of the Contact Form emails are going through mailpress. However, mailpress gets all the data for the emails except the “To” part. So none of the contact form emails are reaching us any more. What should I do?

Thanks for very useful plugin. How do I get the ‘From’ address in the email received by the recipient to be something other than noreply@.com ?

I am wondering if the problem of the email address of the sender not showing up in the email / customizations of the email not actually working

problem is being worked on? I’ve been running this plugin for about 8 months, and as soon as I upgraded to the new version it stopped working. I’ve had to take it down off my site (since I don’t see anyone’s return email addresses), and I was wondering if this problem was being worked on.

As it stands, the plugin is non-functional, so I’m trying to decide if I should simply start using another plugin, or if there are plans to actually fix this critical problem

thanks

Looked good but I could not find any easy way to control the css of the form so for me it was not usable…

Excellent plugin!

you could improve usability by making the label of checkboxes and radio buttons into, well, labels.

The following patch does the trick, please apply this for your next release!

— wp-contact-form-7.php (revision 47)
+++ wp-contact-form-7.php (working copy)
@@ -1352,11 +1352,11 @@
! $multiple && $_POST[$name] == $value))
$checked = ‘ checked=”checked”‘;
if (preg_grep(‘%^label[_-]?first$%’, $options)) { // put label first, input last
– $item = ” . $value . ‘ ‘;
– $item .= ”;
+ $item = ” . $value . ‘ ‘;
+ $item .= ”;
} else {
– $item = ”;
– $item .= ‘ ‘ . $value . ”;
+ $item = ”;
+ $item .= ‘ ‘ . $value . ”;
}
$item = ” . $item . ”;
$html .= $item;

I really like the way your Contact Form 7 is supposed to work. Unfortunately, every time I create a contact form, when I hit “save” I get a “page not found” error and, alas, no contact form is saved.

I installed on the newest version of WP with my own hosting. Anything you can suggest to make it work would be greatly appreciated. I think this will work in exactly the way I need to – if I can get it to work.

Thank you in advance!

just installed the plug-in and everything works .. it’s just that there is a long delay .. like 30-40 minutes after the form is submitted and I receive the eMail .. what’s up with that?

The admin page under the Tools section is not a good idea imho.
Kinda weird localisation !

The correct emplacement would be the Settings section.

Good plugin however

Very nice plugin, but I’m now trying to show up contact form inside Category Description, but without success. What can I do to make it show inside category description ?

Thanks a lot.

thanks for great work on your plugin.
one thing though:

>> wrong .zip file path!

the auto-install and unpacking in wordpress 2.7.X is not working because it downloads the .zip file into /wp-content instead of wp-content/plugins/!

I can’t get this to work at all. I have installed akismet and added tags, and placed the contact form tag in my sidebar, but I only get spinning arrows upon pressing the send button from my page.

How can I receive assistance in getting this working…?

Thx…

Great plug-in, just wanted to reiterate two concerns:

1) The “from” in the emails received show the site admin and NOT the sender. I added a `From: [your-name] ` to the message body to work around that but obviously something’s not working right.

2) There really is a long delay between submitting the form and receiving the email. This isn’t as crucial but it does make me nervous that emails might get lost (although this might be an iirrational fear)

Thanks!

Good plugin but I got this weird problem where in text fields and text areas it won’t allow me have have any spaces between the characters. I tried everything I can think of and can’t figure it out. Ideas?

Hi there,

Thank you for the great plugin but is there any way to re-direct to another page on submit?

For those of you that would like to embed this in a template using php, this worked for me:

echo apply_filters(‘the_content’,’[contact-form 1 "Contact form 1"]‘);

Love the plugin, thank you! Is there a way to add a BCC field? Can more Mail option be added? There is Mail and Mail (2), can more be added by?

Thanks for the plugin!

For those experiencing a delay between form submission and when you receive the form – it is doubtful that it’s the plugin’s fault. It probably has something to do with your server/hosting. The same might be said for those who are receiving forms with an improper “from” (in other words it’s showing up as coming from your server).

I confirm the previous comment, this plugin is a MUST HAVE

@jeannedb:

I’m using Contact Form 7 with hostmonster.com

I have many websites on the same hosting account and only Contact Form 7 has this problem (mails showing as being sent from server email address …@host75.hostmonster.com)

[…] 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 […]

When testing this plugin it tells me the following:
Failed to send your message. Please try later or contact administrator by other way.

What am I doing wrong?

Thanks.
Conrad

@Conrad Theart

Your server might not have mail() enabled – especially if you’re using a personal server like xampp or vertrigo.

Try checking the mail settings in phpinfo() or contacting the folks who host your server.

I am using contact form in some of my posts:is there a way or syntax to write in Subject mail field in order to let me know from which post the contact form has been filled in?
Thanks.

@muymalestado – myself, and others mentioning the non-receopt of the To: data

I have installed separately on a different hosting service and the data all comes through just fine. The Reply to sender is OK.

So, does that confirm it is a server issue?

hi, the contact form is installed correctly, but when i send msg, it is nowhere at my inbox.
is there any solution for this?

I use WP 2.7 and XP.

thanks

hello! thank you so much for this! is there a way to use a custom image for the submit button instead of the default?

Nice plugin.
It seems to work, but when it says “thanks, mail sent”
I do not reecive any mail!

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