Tag Syntax

Contact Form 7 allows you to edit the templates of your contact forms and your mail (mail headers and message body) with various “tags.” In the terminology for Contact Form 7, tag means a tiny formed string of type enclosed in square brackets ([ ]).

Tags for forms and tags for mail look different from each other, for example, you can use [text* your-name] in your form and [your-name] in your mail. They each have a different syntax.

Form Tag Syntax

A tag in a form template (“form tag”) will be replaced with an HTML element which represents an input field when it is displayed in an actual form. Components of a form tag are able to be separated into four parts: type, name, options and values.

form tag example

Type is the most important factor, as it defines what type of HTML element will replace itself, and what kind of input is expected through it.

Name is used for identifying the input field. Most form tags have a name, but there are exceptions.

Options specify details of behavior and appearance. Options are optional.

In most cases, values are used for specifying default values. It is possible that values can be used for other purposes as well; it depends on the type of the tag. Values are optional.

See also

Mail Tag Syntax

A tag in a mail template (“mail tag”) is much simpler. A mail tag has only one word in it. In most cases, the word corresponds to the name of a form tag, and it will be replaced with the form input through it.

mail tag example

6 responses to “Tag Syntax”

  1. Ron

    Is there a way to set the tabindex in Contact Form 7?

  2. JD Sullivan

    Awesome Plugin. Simple to use, documentation easy to figure out. Thank you so much!

  3. Daniel Schmidt

    Great PlugIn, very useful – but is there a way to attach a class to the submit-button? [submit "send" class:myclass] dosn’t work…

  4. Alexandre Ferreira

    Very nice plugin, congrats!

I'm Speaking At
WordCamp Fukuoka 2010
Beginners Guide
Plugin support provided by WordPress HelpCenter.