How Tags Work

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.

Note that order of those parts is important. Options can’t come before name, and Values can’t come before Options.

List of Form-tag Types

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

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