FAQ

Where is the settings page for Contact Form 7?

Log into WordPress and open Contact > Contact Forms.

Screenshot of Contact Form 7's Admin Screen

See also: Admin Screen

How can I add a contact form into my post content?

Open the settings page for Contact Form 7, and then open the contact form you want to add.

Each contact form has its own tag (shortcode), such as [contact-form-7 id="1234" title="Contact form 1"]. To insert the contact form into your post, copy the shortcode and paste it into the post content.

Short code sample

My contact form doesn’t appear. Instead, a code [contact-form-7 404 "Not Found"] appears.

The code [contact-form-7 404 "Not Found"] is a sign that the contact form specified by the shortcode (described in the previous answer) couldn’t be found. Make sure you are using the correct shortcode.

How can I add a field to my contact form?

To add a field, add a tag to the Form textarea.

Form template sample

Each tag has a strict syntax, supporting several options (see Tag Syntax).

Learning the syntax might be difficult, but you can easily make a custom tag by using the tag generator instead. Click Generate Tag and simply select the options you’re interested in.

Nothing shows up in the email, even after adding a tag to the form! How can I include a new field’s input in the email?

You need to add a new tag to the Mail fields. This tag should correspond to the tag in the Form you wish to include in the email. Thus, when you add a new form tag such as [text your-new-field], the corresponding email tag would be [your-new-field]. Only the second part of the tag (“your-new-field”, in this case) is needed for the email.

Mail template sample

A tag in the Mail field will be replaced with the user’s input contained in a form field with the same name.

See also: How Tags Work

I get emails containing codes such as [foobar]. What’s this? I want to see the user’s input.

See the previous answer. In this case, no form tag corresponds to the [foobar] email tag. A tag in the Mail field which has no corresponding tag in the Form will be left without replacement.

Are there any reserved or unavailable words for the name of an input field?

Yes, there are some words that are not available; but this is actually not a restriction of Contact Form 7, but a restriction of WordPress.

If you post an input field with a name that is the same as a parameter name already used in a WordPress query, WordPress will confuse them, so you can’t use that name.

For example, ‘name’ is used in the query, so ‘name’ is not available for a field name. The best practice in avoiding unavailable names is adding a prefix or suffix to the name, for example, use ‘your-name’ or ‘name-1234′ instead of ‘name’.

See also: My contact form always redirects to 404 error page after submission.

How can I specify a subject for the email?

Simply edit the Subject field in the Mail section (not in the Form section).

Can I see the messages submitted through the contact form?

Contact Form 7 doesn’t save the submitted messages. To manage messages through Contact Form 7, you need to install Flamingo (another plugin created by the same developer).

Can I implement autoresponder?

Yes, of course. Simply check the “Use mail (2)” box in your form configuration panel. Mail (2) is almost the same as Mail, except that Mail (2) is sent only when Mail has been sent successfully.

Mail that comes through the contact form shows “WordPress” as its sender name. How can I change this?

A sender’s address is comprised of a sender’s email address and an optional sender name. WordPress assigns “WordPress” as a sender name if the settings have not been formatted. If you want to use another name so that “WordPress” no longer appears as your sender name, you must explicitly set the sender name in the ‘From:’ field in the ‘Mail’ section as the following:

Sender Name <sender@example.com>

Can I place a contact form outside a post?

Yes. You may place a contact form in a text widget as well.

Can I embed a contact form into my template file?

Yes, but you cannot insert a contact form shortcode into your template file directly. You will need to pass the code into do_shortcode() function and display its output like this:

<?php echo do_shortcode( '[contact-form-7 id="1234" title="Contact form 1"]' ); ?>

After submitting the form, I get an error message stating “Failed to send your message”. What is wrong?

There could be two causes for this. The first is actual mail server trouble, where email cannot be sent. In this case, the error message would be surrounded with a RED border line. Contact your server admin.

The second possible cause is that the form submission is under suspicion of spam. In this case, the error message would be surrounded with an ORANGE border line.

response message samples

I get an error message with a red border. So, how can I solve this?

There are really various reasons for server side problems, so I can’t explain exactly what yours is. But experiences of other users who solved their problem might be helpful for you.

Mario Vargas says he solved a mail-related problem with WP-Mail-SMTP plugin.

Buzztone has written a comprehensive and detailed explanation about Contact Form 7 Email Issues. Helpful when you really need to fix this problem. The article covers the following items that can commonly cause email sending problems with this plugin (and WordPress in general):

I get an error message with an orange border even though I don’t use Akismet.

The orange border is a sign of spam.

Akismet, the spam filtering plugin, used to be the only reason for this orange border, but on the Contact Form 7 3.1 (or later versions), the error message with the orange border occurs for multiple reasons.

Contact Form 7 3.1 has introduced nonce verification for contact forms. If the verification fails, Contact Form 7 treats the form submission as spam. This can occasionally cause false-positives when using cache plugins. When an old cache file remains for longer than 24 hours, nonce verification will fail, and you’ll see an error with an orange border.

To solve this problem, make sure you have the appropriate garbage collection (clean-up) settings in the cache plugin. The cache should be emptied frequently (less than 24 hours). The configuration varies in different cache plugins. Consult your cache plugin’s support for details.

I see a response message “Your message was sent successfully” with green border, but I never receive a mail for that.

Showing the green border message means that the PHP function for sending the mail has certainly completed successfully. So if you can’t receive the mail, it’s highly possible that the mail has been kidnapped or killed after that.

If you can check the log of your mail server, it could give you some clues. Spam filter often causes this kind of problem.

My contact form always redirects to 404 error page after submission.

This problem is caused by a combination of two misconfigurations. First, AJAX JavaScript is not functioning on your contact form. Due to this problem, your contact form needlessly redirects after submission. Second, your contact form uses unavailable words in the names of input fields. This issue confuses WordPress, resulting in the 404 (“Not Found”) error.

The spinning arrow icon shows up once I submit a form, but then nothing happens.

This is most probably due to a conflict between plugins/theme. Try deactivating all other plugins and switching to the default theme.

Buzztone has written an explanation about Plugin or Theme Conflicts – both with this plugin (and WordPress in general). Helpful when you need to look in detail at this issue.

My contact form behaves oddly on certain browsers.

This may be caused due to invalid HTML, CSS, or Javascript. Please check your form page with a validator or debugging tool.

Useful tools:
Firebug — Firefox extension. Good for Javascript debugging.
XHTML-CSS Validator — A validator with a good UI.

I want to use contact form in my language, not in English. How can I do that?

Contact Form 7 has been translated into many languages. See if the languages folder contains a language file for your language.

The locale setting of Contact Form 7 follows the locale setting of WordPress. Once you change the WordPress locale to, Contact Form 7 is also changed. See how to change the WordPress locale here.

See also: Contact Form in Your Language

CAPTCHA does not work; the image does not show up.

To use CAPTCHA, you need GD and FreeType library installed on your server.

Also, make sure that CAPTCHA’s temporary folder is writable. Contact Form 7 refers your upload folder setting in Settings > Media menu for resolving the base directory for CAPTCHA’s temporary folder. For example, when your upload folder is set “wp-content/myfiles”, CAPTCHA temp files will be created in wp-content/myfiles/wpcf7_captcha, so you need to make that folder writable.

See also: Tips for troubleshooting Really Simple Captcha issues

CAPTCHA’s text input box is working on Internet Explorer, but not with Firefox. I cannot enter the code.

This is a well-known issue caused by misusing the <label> element. Make sure you are using it correctly.

This is good:

[captchac your-captcha]
<label>Enter the code: [captchar your-captcha]</label>

This will not work correctly:

<label>[captchac your-captcha]
Enter the code: [captchar your-captcha]</label>

File upload & file attachment do not work.

See this post.

File Uploading and Attachment

Does Contact Form 7 support HTML5 input types?

Yes. Contact Form 7 3.4 and higher support form-tags corresponding to these HTML5 input types: email, tel, url, number, range and date.

If you don’t wish to use HTML5 input types, you can disable this by adding the following code into your theme’s functions.php file:

add_filter( 'wpcf7_support_html5', '__return_false' );

Note that even the most current browsers partially support HTML5. For example, the latest Firefox doesn’t support the date input type (that allows you to choose a date from a calendar user interface) and the number input type (that allows you to input a number value from a spinbox UI) yet — so Firefox provides a general text input field as a fallback instead of a calendar and spinbox UI. This may confuse users because they can’t detect what type of input value this field expects. So, you may feel that it is better to wait for all browsers to support all HTML5 features completely.

But you don’t need to wait! Contact Form 7 offers a better solution. Contact Form 7 is able to provide jQuery UI-based fallback for the date and number input fields. By using this solution, you can provide calendar UI for the date field and spinbox UI for the number field, respectively, even with Firefox or Internet Explorer.

By default, this fallback feature is disabled because it loads extra JavaScript and CSS (makes for poor performance) and it is only necessary for websites that use the date or the number input fields. If you use the date or number input fields and wish to use this jQuery UI-based fallback feature, add the following code into your theme’s functions.php file and activate the feature:

add_filter( 'wpcf7_support_html5_fallback', '__return_true' );

See also: Loading JavaScript and Stylesheet Only When it is Necessary

Why does my email address input field look different than other text input fields?

In HTML5, the email input field is represented as <input type="email" />. The text input field is represented as <input type="text" />. There is a difference in the ‘type’ attribute value.

Review your theme’s CSS style sheets. You will find some items using attribute selector like this:

input[type="text"]
{
	...
}

This ‘input[type="text"]‘ selector doesn’t match the email field because it doesn’t have the ‘text’ type. If you wish to apply this style rule to email fields as well, add a selector that matches email fields:

input[type="text"],
input[type="email"]
{
	...
}

See also: Styling Contact Form

Can I add id and class attributes to a form element?

Yes. You can add any id and class to a form by adding the html_id and html_class attributes into a [contact-form-7] shortcode.

Example:

[contact-form-7 id="1234" title="Contact form 1" html_id="contact-form-1234" html_class="form contact-form"]

How can I export/import contact form data?

Because Contact Form 7 stores its contact form data as a custom post (post type: wpcf7_contact_form), you can export and import form data via Tools > Export and Tools > Import in the WordPress admin screen.

In the Export menu, choose “Contact Forms” if you want to export contact form data only. You can also choose “All content” (this includes contact form data).

Just another contact form plugin for WordPress. Simple but flexible.