BlogGuides · October 20, 2026 · 5 min read

Contact Form 7 Custom Form-Tags: Add a Reusable Notice Without a New Field

Register a display-only CF7 form-tag in a small plugin, return escaped notice markup, and verify caching, placement and submission boundaries.

A Contact Form 7 custom form-tag can insert a reusable piece of presentation into several forms. For example, a service team may want the same short response-time notice wherever a quotation form appears. A display-only tag keeps that wording in one maintained location without adding a field, changing the submitted data or editing Contact Form 7 itself.

A hand fits a mint information puzzle tile into an ivory form card beside a matching reusable tile.
Generated conceptual illustration; not a product screenshot or measured result.

This developer guide builds that limited example. It does not create a custom input control: a new input would also need a deliberate naming, validation and mail-output design. Start with the existing form-tag and mail-tag distinction if those two template layers are unfamiliar.

Decide whether a custom tag earns its maintenance cost

Ordinary HTML in the Form tab is enough for a notice used once. A custom tag becomes useful when several forms share wording that an identified developer maintains. Keep the first implementation deterministic: one tag returns one static message. Avoid a database lookup, a remote request or a personalized promise until there is an actual requirement and a tested failure behavior.

Write the expected result before touching code. In this example, the form displays a short statement about business-day replies; no extra answer appears in the email and no analytics event is emitted. The business must approve that statement. A reusable component can spread an inaccurate service promise just as efficiently as an accurate one.

Register the tag in a small site plugin

The official custom form-tag recipe registers tags on wpcf7_init. The current form-tags manager source still exposes wpcf7_add_form_tag(). Use a unique lowercase type so another extension is unlikely to own it already.

Create a small, version-controlled site plugin in your development environment. Use your normal deployment process, rather than pasting this into an active production editor. The minimal header follows the WordPress plugin header requirements. The example is a starting implementation to review against your installed versions, not a claim of testing on your site.

<?php
/**
 * Plugin Name: Example CF7 Service Notice
 */
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

add_action( 'wpcf7_init', function () {
    wpcf7_add_form_tag( 'example_service_notice', function ( $tag ) {
        $message = 'We usually reply within two business days.';
        return '<p class="example-service-notice">'
            . esc_html( $message ) . '</p>';
    } );
} );

The callback returns markup. It does not print markup with echo, register a WordPress shortcode or modify a core CF7 tag. There is no name-attr feature because this component has no submitted name or answer. Registering a display component is a much smaller commitment than implementing a new field type.

Insert the tag where the notice belongs

After activating the reviewed plugin on staging, add the following line in the CF7 Form tab. Place it between complete field groups, not inside an existing label or paragraph: the callback already returns a paragraph element.

[example_service_notice]

Preview the actual page containing the form. The tag belongs inside a CF7 template; dropping it into an unrelated page paragraph does not give it the same meaning. If the literal bracketed text remains visible, check that the plugin is active, that the type matches exactly and that registration runs on the expected hook. Search your codebase for the type before assuming a CF7 parsing defect.

Escape output and keep the message independent of visitors

The example escapes the message with esc_html() while keeping the small HTML wrapper under developer control. That follows WordPress guidance to escape for the output context. If you later add a URL or an attribute, use the relevant escaping function for that location instead of treating one function as universal protection.

Do not use a query parameter to build an unreviewed notice. A message such as “approved customer” must not come from a visitor-editable value. Likewise, a display-only tag is not a permission check. If different users must see different information, specify authorization, cache variation and fallback behavior as a separate feature.

Check caching and translated wording

A cached page can retain an older notice after the PHP value changes. On staging, compare a fresh uncached request with the normal cached page. After an approved release, refresh only the affected page caches through the site’s established process. Record which forms use the component so the editor knows where wording changes will appear.

For a multilingual site, introduce a proper translation domain and translated string as part of the plugin’s internationalization work. Do not promise language awareness merely because the form itself has translated labels. Verify the notice on every language variant, using the existing CF7 language-version checklist.

Verify the boundaries before release

  • Open every affected form on desktop and a narrow mobile viewport; the notice must not overlap fields or hide validation messages.
  • Check the reading order and contrast. A static notice generally does not need a live-region announcement.
  • In an isolated environment with captured mail, confirm that an ordinary valid submission still works and that the notification has no unexpected extra field.
  • Disable the site plugin on staging and document the resulting missing-component behavior before relying on a rollback.
  • Repeat a small regression check after a CF7 or site-plugin update.

A form-tag callback may be evaluated more than once during rendering or processing. Keep it free of side effects: no counter increments, email sends or lead creation. If you need to validate a new answer, follow a dedicated custom validation design rather than adding hidden behavior to this notice.

Once presentation is stable, review submission trends with Svetlik Analytics for Contact Form 7, our free plugin. Those statistics can support ongoing form review; the notice itself creates neither a measured conversion improvement nor an inbox-delivery guarantee.