Skip to main content

Contact Form 7 Accessibility: Template, Errors, CAPTCHA

Information about the article

Portrait of Dmitry Dugarev

Author: Dmitry Dugarev

Consultant for digital accessibility & IT compliance

Last updated on:

You build forms with Contact Form 7 and want to know whether they are accessible. Contact Form 7 accessibility is achievable, but it does not happen by itself. You write the labels, groups and hints into the form template yourself. I read the source code of version 6.1.7. Below I show you what to add.

In short
  • Contact Form 7 adds aria-required and aria-invalid to text and select fields. It also has a status message for screen readers [1], [2].
  • Labels, fieldset and visible required-field hints are missing until you write them into the template.
  • The plugin does not move focus to the first error. It also disables the submit button until the user gives consent. You can change both with little effort.
  • For spam protection without puzzles, use a honeypot, Akismet or Turnstile. Skip image CAPTCHAs.

What Contact Form 7 gets right out of the box​

According to WordPress.org, Contact Form 7 has more than 10 million active installations [3]. It turns form tags such as [text* your-name] into the HTML of the fields. Some of that HTML already helps screen readers.

  • Required fields: Text, email, textarea, select and date fields with an asterisk get aria-required="true" [1], [4], [5], [6].
  • Error state: These fields and the consent checkbox carry aria-invalid. After an error, the value changes to true [1], [7], [8].
  • Error text on the field: Each field points with aria-describedby to its entry in a hidden error list [8].
  • Status message: A hidden region with role="status" and aria-live="polite" sits above the form [2]. The message appears there after the user submits the form [9].
  • Form name: The form element gets an aria-label. You set it with the shortcode attribute html_title [2], [10]. Without the attribute, the plugin uses its translated default text. In English, that is "Contact form". On a German site, it is "Kontaktformular" [2], [11].

The visible error text carries aria-hidden="true" [8]. Screen readers still read the error. aria-describedby points to the same text in the hidden error list [8]. This way, the user hears it only once.

This status message is in line with WCAG 4.1.3 [12].

Contact Form 7 accessibility gaps​

In my audits, I see the same gaps again and again. Most of them come from the template, not from the plugin.

Fields without a label​

A form tag creates only the input field, not a label. The default template wraps each field in a label [13]. But in many templates I see only a placeholder instead of a label.

But a placeholder is not a label, because screen readers do not treat it as the field's name [14]. WCAG 3.3.2 requires labels or instructions when the user has to enter something [15].

Radio buttons without a group​

Radio buttons and checkboxes sit inside a span, not a fieldset [16]. Screen reader users then miss the question the group asks. Each option gets its own label only if you add the use_label_element option [16].

The W3C recommends that you always group radio buttons with fieldset [17]. Without a group, you can easily fail WCAG 1.3.1 [18].

Checkbox and radio groups also get neither aria-required nor aria-invalid [16]. The aria-describedby with the error message sits on the surrounding span, not on the options [8], [16]. So when an option has focus, its description does not include the error text.

No focus on the first error​

After a failed submit, focus stays on the button. I found no code in the 6.1.7 source that moves focus to the first error [8], [9]. The screen reader announces only the general message. The user has to find the invalid field on their own.

The hidden error list contains links to the fields, if the fields have an ID [8]. The plugin hides the list only visually [19]. Keyboard users can reach the links with the Tab key, but they cannot see where the focus is. Check this in your form after an error, because WCAG 2.4.7 requires a visible focus [20].

Wrong language on the form​

When you create a form, Contact Form 7 saves a language. It writes this language as a lang attribute on the outer container [2]. If someone creates the form in an English admin interface, the container can end up with lang="en-US" while the labels are in German. Screen readers pick their pronunciation based on this attribute, so the German text sounds wrong [21]. This affects WCAG 3.1.2 [22].

Accessible contact form in WordPress: the template​

These steps turn Contact Form 7 into an accessible contact form for your WordPress site.

Connect each label with for and id​

Give every field a fixed ID with the id: option. The for attribute of the label points to exactly this ID [23]. The hidden error list also links to a field only when the field has an ID [2], [8].

Watch out for two exceptions. The plugin drops IDs that start with "wpcf7" [24]. It also drops an ID that already exists on the page [24]. If you embed the same form twice on one page, for example in the content and in the footer, the fields of the second copy lose their labels.

Mark required fields visibly​

aria-required helps only screen reader users. Everyone else needs a visible hint in the label. Explain the asterisk once at the top of the form [25]. H90 also shows how to display the asterisk larger, because people with low vision may find it hard to see [25].

autocomplete for personal data​

Fields for name, email or phone need a matching autocomplete value [26]. In Contact Form 7, you add autocomplete:name to the tag, for example [13]. Browsers can then fill in these fields automatically [27].

Template for an accessible contact form​

Copy this template into the "Form" tab. Then adjust the text and links.

Contact Form 7: form template
<p>Fields marked with * are required.</p>

<p><label for="cf7-name">Name *</label>
[text* your-name id:cf7-name autocomplete:name]</p>

<p><label for="cf7-email">Email address *</label>
[email* your-email id:cf7-email autocomplete:email]</p>

<p><label for="cf7-phone">Phone number (optional)</label>
[tel your-phone id:cf7-phone autocomplete:tel]</p>

<p><label for="cf7-company">Company (optional)</label>
[text your-company id:cf7-company autocomplete:organization]</p>

<fieldset>
<legend>How would you like us to contact you?</legend>
[radio contact-method use_label_element default:1 "By email" "By phone"]
</fieldset>

<p><label for="cf7-message">Your message *</label>
[textarea* your-message id:cf7-message]</p>

[acceptance consent id:cf7-consent] I have read the <a href="/datenschutz">privacy policy</a>. * [/acceptance]

[turnstile]

[submit "Send message"]

The plugin itself wraps the consent text of the [acceptance] tag in a label [7]. For more on structure and testing, see the pattern for accessible forms.

Give the form its own name when you embed it. The html_title attribute becomes the aria-label of the form [2], [10].

Shortcode with a form name
[contact-form-7 id="…" html_title="Contact form"]

Do not disable the submit button​

Contact Form 7 disables the submit button until the user ticks the consent checkbox [28]. Nothing tells the user why they cannot submit. A disabled button without an explanation is a barrier.

So add this line in the "Additional Settings" tab [7], [11]:

Additional Settings tab
acceptance_as_validation: on

The button then stays enabled [28]. Missing consent shows up as a normal error on the field [7].

Move focus to the first error​

After an invalid submit, Contact Form 7 fires the wpcf7invalid event on the form [9]. But the event fires before the plugin writes the errors into the fields [9]. That is why the code waits one tick with setTimeout. Then it looks for the first element with the class wpcf7-not-valid [8].

Focus on the first invalid field
document.addEventListener('wpcf7invalid', (event) => {
const form = event.target;

setTimeout(() => {
const first = form.querySelector('.wpcf7-not-valid');
if (!first) return;

const control = first.matches('input, textarea, select')
? first
: first.querySelector('input, textarea, select');

control?.focus();
}, 0);
});

In checkbox and radio groups, the surrounding span carries this class [8], [16]. The code then moves focus to the first option of the group. The screen reader announces the label, and for text fields also the error state. For the steps in detail, see the tutorial for an accessible contact form.

Write error messages people understand​

You edit the texts in the "Messages" tab [11]. Contact Form 7 uses one message per type of error, not per field [13]. The English message for empty required fields is "Please fill out this field." [13]. On a German site, visitors see "Bitte fülle dieses Feld aus." [11].

So the message does not name the field. With three empty fields, the hidden error list shows the same sentence three times [8]. That is why you need the focus code above. It moves focus to the field, and the screen reader announces its label.

Still, keep the messages clear and friendly. For example: "This required field is empty. Please fill it in." WCAG 3.3.1 asks you to describe the error in text [29].

Do not rely on color alone for errors​

Contact Form 7 shows the error as text below the field, in the color #dc3232 [19]. By my calculation, this gives a contrast ratio of 4.6:1 on white. WCAG 1.4.3 requires at least 4.5:1 for normal text [30]. On a light gray background, the color quickly falls short.

The plugin does not add a red border around the field [19]. If your theme only changes the border color on an error, that is not enough under WCAG 1.4.1 [31]. Measure the contrast of the error text in your theme with the contrast checker.

CAPTCHA and spam protection: what stays accessible​

Classic CAPTCHAs lock out many people with disabilities. The W3C describes problems for blind, deaf and cognitively impaired users [32]. It recommends non-interactive methods first, such as honeypots and spam filters [32]. For CAPTCHAs, WCAG 1.1.1 requires alternatives for different senses [33].

MethodWhat the user has to doMy assessment
Honeypotnothinggood first choice
Akismetnothinggood, no challenge
reCAPTCHA v3nothingpossible, adjust the spam message
Turnstileusually nothing, sometimes one clickpossible, test the checkbox
Quiz questionanswer a questionlast resort only
Image CAPTCHAtype the charactersavoid

Honeypot and Akismet​

A honeypot is a hidden field that only bots fill in. The W3C lists it as an alternative that several WordPress plugins offer [32]. Contact Form 7 has a built-in Akismet integration [3].

There is a dedicated honeypot plugin for Contact Form 7. Version 1.11 fixed a missing label on the hidden field and turned off autocomplete there [34].

reCAPTCHA v3 and Turnstile​

reCAPTCHA v3 shows no challenge. It returns a score between 0.0 and 1.0 for each request [35]. Google leaves it to the website to decide how to react to a low score [35].

In Contact Form 7, a score of 0.5 or lower counts as spam [36], [37]. The visitor then sees only the general message "There was an error trying to send your message" [13]. On a German site, it reads "Beim Versuch, deine Nachricht zu senden, ist ein Fehler aufgetreten" [11]. A real person with a low score gets stuck.

Rewrite this message in the "Messages" tab. Add an email address or phone number as a fallback. You change the threshold with the wpcf7_recaptcha_threshold filter [37].

Cloudflare Turnstile states that it meets WCAG 2.2 AA [38]. In "Managed" mode, the visitor sometimes has to click a checkbox [39]. Test this case with a keyboard and a screen reader.

Put the [turnstile] tag directly before the submit button. Without the tag, Contact Form 7 places the widget at the top of the form [40]. The check then comes before the first field, and keyboard users reach it before they fill in anything. Directly before the button, the check fits the flow better.

Both services can send personal data, such as the IP address, to the provider [3].

Quiz and image CAPTCHA​

The [quiz] tag asks a question that the user has to answer [41]. The W3C warns that such questions create serious barriers for people with language, learning or cognitive disabilities [32]. Even simple math problems are hard for people with dyscalculia [32].

So use the quiz only as a last resort, when a honeypot and Akismet are not enough. Then ask a very simple question without math. I never put image CAPTCHAs with distorted characters on a form.

When another form plugin is a better fit​

You can build an accessible WordPress form with Contact Form 7 if someone on your team writes HTML. If your editors build many forms without HTML, a plugin with a ready-made structure is often a better fit.

Gravity Forms states WCAG 2.1 AA as its target [42]. Since version 2.5, fields with several inputs sit in a fieldset with a legend [42]. But the vendor also says that the website owner is always responsible for accessibility [42]. For an overview, see the article on WordPress accessibility plugins.

The add-on plugin "Contact Form 7: Accessible Defaults" gives you ready-made templates for new forms. It does not change existing forms [43]. WordPress.org also warns that the author has not tested it with the last three major versions of WordPress [43].

How to test your form​

  1. Fill in the form with the keyboard only. You must be able to reach every field and the CAPTCHA checkbox.
  2. Submit the form empty. Check where focus goes and what the screen reader says.
  3. Then press Tab from the top of the page. Check whether focus lands on hidden links.
  4. In the page source, check the lang attribute on the div.wpcf7 container.
  5. Listen to radio groups with NVDA or VoiceOver. You must hear the question of the group.

The form checklist lists every check. The guide to WordPress accessibility shows how forms, themes and page builders work together.

Our free BFSG check tests 20 of the 55 criteria automatically, at least in part. The other 35 can only be tested manually, because a tool cannot judge meaning and operability. That is why I test the focus after an error by hand in the Basis-Audit. If you want, I can also take care of the remediation in your theme, without a relaunch.

Contact Form 7 and the EAA in Germany​

The European Accessibility Act (EAA) is the EU law. Germany implements it through the BFSG (Barrierefreiheitsstärkungsgesetz, the German Accessibility Strengthening Act). The BFSG has applied since June 28, 2025 [44]. It covers "services in electronic commerce" (§ 1 Para. 3 No. 5 BFSG) [44]. This means digital services on websites and in apps that aim at a contract with a consumer (§ 2 No. 26 BFSG) [44].

To find out if your website falls under the law, use the BFSG relevance check. The article Who must make their website accessible? explains more. If your website falls under the law, I test the contact form in the audit like any other function, against WCAG 2.2 Level AA [45].

Frequently asked questions (FAQ)​

Is Contact Form 7 accessible?​

Partly. The plugin adds aria-required and aria-invalid to text and select fields and has a status message for screen readers [1], [2]. You add the labels, groups and focus on errors yourself.

How do I make a WordPress contact form accessible?​

Give every field a visible label. Group radio buttons with fieldset and legend [17]. Mark required fields visibly and describe errors in text [29]. Test the result with a keyboard and a screen reader.

Does my Contact Form 7 form have to be accessible under the BFSG?​

That depends on your website, not on the plugin. The BFSG covers services in electronic commerce (§ 1 Para. 3 No. 5 BFSG) [44]. If your form leads to a contract with a consumer, for example through an inquiry or an order, it can fall under the law (§ 2 No. 26 BFSG) [44].

Microenterprises that provide services are exempt (§ 3 Para. 3 BFSG) [44]. The page on the microenterprise exemption has the details. To find out how far the obligation goes in your case, use the BFSG relevance check. If in doubt, ask a lawyer.

Is reCAPTCHA accessible?​

reCAPTCHA v3 shows no challenge [35]. But in Contact Form 7, a low score blocks the message, and the visitor sees only a general error message [13], [36]. Add another way to reach you to this message. The W3C recommends methods without user interaction, such as honeypots, first [32].

Disclaimer​

This article is for information only and is not legal advice. The details on Contact Form 7 refer to the source code of version 6.1.7. The details on other services are current as of September 2026. I accept no liability for accuracy or completeness.

​

  1. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: modules/text.php.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/modules/text.php ⤴
  2. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: includes/contact-form.php.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/includes/contact-form.php ⤴
  3. Rock Lobster Inc., “Contact Form 7 – WordPress-Plugin, Version 6.1.7.” 2026. [Online]. Available: https://wordpress.org/plugins/contact-form-7/ ⤴
  4. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: modules/textarea.php.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/modules/textarea.php ⤴
  5. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: modules/select.php.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/modules/select.php ⤴
  6. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: modules/date.php.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/modules/date.php ⤴
  7. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: modules/acceptance.php.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/modules/acceptance.php ⤴
  8. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: includes/js/src/validate.js.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/includes/js/src/validate.js ⤴
  9. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: includes/js/src/submit.js.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/includes/js/src/submit.js ⤴
  10. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: includes/contact-form-functions.php.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/includes/contact-form-functions.php ⤴
  11. WordPress.org Polyglots, “Contact Form 7: deutsche Übersetzung (Stable), translate.wordpress.org.” 2026. [Online]. Available: https://translate.wordpress.org/projects/wp-plugins/contact-form-7/stable/de/default/ ⤴
  12. W3C, “Success Criterion 4.1.3 Status Messages,” 2023, [Online]. Available: https://www.w3.org/TR/WCAG22/#status-messages ⤴
  13. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: includes/contact-form-template.php.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/includes/contact-form-template.php ⤴
  14. W3C Web Accessibility Initiative (WAI), “W3C Forms Tutorial: Placeholder text.” 2023. [Online]. Available: https://www.w3.org/WAI/tutorials/forms/instructions/#placeholder-text ⤴
  15. W3C, “Success Criterion 3.3.2 Labels or Instructions,” 2023, [Online]. Available: https://www.w3.org/TR/WCAG22/#labels-or-instructions ⤴
  16. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: modules/checkbox.php.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/modules/checkbox.php ⤴
  17. W3C Web Accessibility Initiative (WAI), “W3C Forms Tutorial: Grouping Controls.” 2023. [Online]. Available: https://www.w3.org/WAI/tutorials/forms/grouping/ ⤴
  18. W3C, “Success Criterion 1.3.1 Info and Relationships,” 2023, [Online]. Available: https://www.w3.org/TR/WCAG22/#info-and-relationships ⤴
  19. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: includes/css/styles.css.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/includes/css/styles.css ⤴
  20. W3C, “Success Criterion 2.4.7 Focus Visible,” 2023, [Online]. Available: https://www.w3.org/TR/WCAG22/#focus-visible ⤴
  21. W3C, “Understanding Success Criterion 3.1.2: Language of Parts.” 2023. [Online]. Available: https://www.w3.org/WAI/WCAG22/Understanding/language-of-parts.html ⤴
  22. W3C, “Success Criterion 3.1.2 Language of Parts,” 2023, [Online]. Available: https://www.w3.org/TR/WCAG22/#language-of-parts ⤴
  23. W3C Web Accessibility Initiative (WAI), “W3C Forms Tutorial: Labeling Controls.” 2023. [Online]. Available: https://www.w3.org/WAI/tutorials/forms/labels/ ⤴
  24. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: includes/form-tag.php.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/includes/form-tag.php ⤴
  25. W3C, “H90: Indicating required form controls using label or legend,” 2023, [Online]. Available: https://www.w3.org/WAI/WCAG22/Techniques/html/H90 ⤴
  26. W3C, “Success Criterion 1.3.5 Identify Input Purpose,” 2023, [Online]. Available: https://www.w3.org/TR/WCAG22/#identify-input-purpose ⤴
  27. W3C, “H98: Using HTML autocomplete attributes,” 2023, [Online]. Available: https://www.w3.org/WAI/WCAG22/Techniques/html/H98 ⤴
  28. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: includes/js/src/helpers.js.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/includes/js/src/helpers.js ⤴
  29. W3C, “Success Criterion 3.3.1 Error Identification,” 2023, [Online]. Available: https://www.w3.org/TR/WCAG22/#error-identification ⤴
  30. W3C, “Success Criterion 1.4.3 Contrast (Minimum),” 2023, [Online]. Available: https://www.w3.org/TR/WCAG22/#contrast-minimum ⤴
  31. W3C, “Success Criterion 1.4.1 Use of Color,” 2023, [Online]. Available: https://www.w3.org/TR/WCAG22/#use-of-color ⤴
  32. W3C Accessible Platform Architectures Working Group, “Inaccessibility of CAPTCHA: Alternatives to Visual Turing Tests on the Web. W3C Group Draft Note, 16. Dezember 2021.” 2021. [Online]. Available: https://www.w3.org/TR/turingtest/ ⤴
  33. W3C, “Success Criterion 1.1.1 Non-text Content,” 2023, [Online]. Available: https://www.w3.org/TR/WCAG22/#non-text-content ⤴
  34. Saad Iqbal, “CF7 Apps – Honeypot, Database, Redirection, Webhook, and Addons for Contact Form 7 – WordPress-Plugin.” 2026. [Online]. Available: https://wordpress.org/plugins/contact-form-7-honeypot/ ⤴
  35. Google, “reCAPTCHA v3.” 2026. [Online]. Available: https://developers.google.com/recaptcha/docs/v3 ⤴
  36. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: modules/recaptcha/recaptcha.php.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/modules/recaptcha/recaptcha.php ⤴
  37. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: modules/recaptcha/service.php.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/modules/recaptcha/service.php ⤴
  38. Cloudflare, “Cloudflare Turnstile.” 2026. [Online]. Available: https://developers.cloudflare.com/turnstile/ ⤴
  39. Cloudflare, “Turnstile widgets.” 2026. [Online]. Available: https://developers.cloudflare.com/turnstile/concepts/widget/ ⤴
  40. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: modules/turnstile/turnstile.php.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/modules/turnstile/turnstile.php ⤴
  41. Rock Lobster Inc., “Contact Form 7, Quellcode Version 6.1.7: modules/quiz.php.” 2026. [Online]. Available: https://github.com/rocklobster-in/contact-form-7/blob/v6.1.7/modules/quiz.php ⤴
  42. Gravity Forms, “Gravity Forms Commitment to Accessibility.” 2025. [Online]. Available: https://docs.gravityforms.com/gravity-forms-commitment-to-accessibility/ ⤴
  43. Joe Dolson, “Contact Form 7: Accessible Defaults – WordPress-Plugin.” 2025. [Online]. Available: https://wordpress.org/plugins/contact-form-7-accessible-defaults/ ⤴
  44. Bundesministerium der Justiz und für Verbraucherschutz, “Gesetz zur Umsetzung der Richtlinie (EU) 2019/882 des Europäischen Parlaments und des Rates über die Barrierefreiheitsanforderungen für Produkte und Dienstleistungen (Barrierefreiheitsstärkungsgesetz – BFSG).” 2023. [Online]. Available: https://www.gesetze-im-internet.de/bfsg/ ⤴
  45. W3C, “Web Content Accessibility Guidelines (WCAG) 2.2.” 2023. [Online]. Available: https://www.w3.org/TR/WCAG22/ ⤴

About the author

Portrait of Dmitry Dugarev

Best regards,

Dmitry Dugarev

Founder of Barrierenlos℠. I test websites by hand and fix the barriers on WordPress websites – without a relaunch.