Title: Hidden fields wrapper change
Last modified: July 3, 2025

---

# Hidden fields wrapper change

 *  [Erik](https://wordpress.org/support/users/codekraft/)
 * (@codekraft)
 * [11 months ago](https://wordpress.org/support/topic/hidden-fields-wrapper-change/)
 * Ciao [@takayukister](https://wordpress.org/support/users/takayukister/),
 * i have noticed that in the recent version of cf7 the wrapper for hidden fields
   has changed and now it is a fieldset tag. May i ask you the reason for this change?(
   I have not found it in the latest [changelogs](https://github.com/rocklobster-in/contact-form-7/compare/v6.0.6...v6.1.0))
 * From what i know (but i can be wrong) it would be more appropriate to use div
   because using a `<fieldset>` in this case is technically not appropriate, as 
   it’s meant to group semantically related form controls and their labels, usually
   with a `<legend>` to describe the group. Since hidden fields aren’t user-facing
   controls and don’t require visual or semantic grouping, wrapping them in a `<
   fieldset>` is semantically incorrect and potentially problematic for screen readers
   or other accessibility tools.
   What do you think? If you confirm me that the change
   is intentional and persistent I will update the code of my plugin

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [11 months ago](https://wordpress.org/support/topic/hidden-fields-wrapper-change/#post-18539062)
 * The corresponding issue is here: [#1636](https://github.com/rocklobster-in/contact-form-7/issues/1636)
 * I changed the wrapper element to `fieldset` because I thought `fieldset` was 
   more appropriate in terms of semantics. A hidden field is a field, so it should
   be in a `fieldset`.
 * That said, if there were specific problems for users, I’m willing to reconsider
   it.
 * > If you confirm me that the change is intentional and persistent I will update
   > the code of my plugin
 * Which plugin do you mean? I don’t think you have to follow my decision, though.
 *  Thread Starter [Erik](https://wordpress.org/support/users/codekraft/)
 * (@codekraft)
 * [11 months ago](https://wordpress.org/support/topic/hidden-fields-wrapper-change/#post-18539091)
 * >  I don’t think you have to follow my decision, though.
 * With my antispam plugin, I need to locate and manipulate the wrapper of the hidden
   field using JavaScript. Currently, I’m using a selector like `form > div`, but
   this no longer works. That’s why I’m asking whether you are going to change that
   wrapper or not.
 * The issue is on my side — I didn’t implement a resilient enough method to select
   it — but I thought it was worth mentioning, as mine might not be the only plugin
   relying on that structure.
 * In any case, thank you for clarifying the reason about that change!
 * P.S. Yes, a `<fieldset>` is meant to group related fields, but it should also
   include a `<legend>` describing its purpose, and i believe that is not the right
   way to wrap hidden fields.
 *  [jeromerdlv](https://wordpress.org/support/users/jeromerdlv/)
 * (@jeromerdlv)
 * [10 months, 3 weeks ago](https://wordpress.org/support/topic/hidden-fields-wrapper-change/#post-18547191)
 * Hi [@takayukister](https://wordpress.org/support/users/takayukister/),
 * I agree with [@codekraft](https://wordpress.org/support/users/codekraft/), to
   be useful a `fieldset` must come with a legend, and is appropriate for visible
   fields only, i.e. radio inputs in a group, or address fields when there could
   be an invoice address and a shipping address.
 * There’s no need to group hidden fields, and `fieldset` may cause accessibility
   issues with some assistive technologies where it could be announced without any
   content.
 * On my side, I have a graphical issue on all my up-to-date sites because `fieldset`
   comes with a default border that shows at the top of my forms.
 * Could you please reconsider this change?
 * Thanks a lot, and have a nice day!
 *  [aubergine262](https://wordpress.org/support/users/aubergine262/)
 * (@aubergine262)
 * [10 months, 2 weeks ago](https://wordpress.org/support/topic/hidden-fields-wrapper-change/#post-18559236)
 * I’d like to request you reconsider the change too – as [@jeromerdlv](https://wordpress.org/support/users/jeromerdlv/)
   notes, the change causes an accessibility issue:
 * “There’s no need to group hidden fields, and `fieldset` may cause accessibility
   issues with some assistive technologies where it could be announced without any
   content.”
 * This update causes sites using CF7 to fail WCAG 2.2AA accessibility compliance.
   Adding a legend to the fieldset wouldn’t be appropriate either, so can we request
   that an alternative to a fieldset is implemented?
 * Thanks.
 *  [jeromerdlv](https://wordpress.org/support/users/jeromerdlv/)
 * (@jeromerdlv)
 * [9 months, 1 week ago](https://wordpress.org/support/topic/hidden-fields-wrapper-change/#post-18612802)
 * Hi [@takayukister](https://wordpress.org/support/users/takayukister/),
 * I just had a look at the [issue #1636](https://github.com/rocklobster-in/contact-form-7/issues/1636),
   which is about removing the `display: none` inline style on the hidden fields
   wrapper. I indeed think that removing that style is OK since hidden fields are
   not rendered by browsers, nor the thus empty `div` container.
 * But may I insist that _hidden_ fields are, by definition, deprived of semantic,
   and that a `fieldset` wrapper makes no sense in that case?
 * Regards,
 *  [huskypup](https://wordpress.org/support/users/huskypup/)
 * (@huskypup)
 * [3 months, 2 weeks ago](https://wordpress.org/support/topic/hidden-fields-wrapper-change/#post-18818084)
 * Hello, may I also add that this is also being flagged as an accessibility issue
   in tools such as Recite Me and Silktide. As stated above sites using CF7 now 
   fail WCAG 2.2AA accessibility compliance, which is a legal requirement for UK
   public sector organisations.

Viewing 6 replies - 1 through 6 (of 6 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhidden-fields-wrapper-change%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 6 replies
 * 5 participants
 * Last reply from: [huskypup](https://wordpress.org/support/users/huskypup/)
 * Last activity: [3 months, 2 weeks ago](https://wordpress.org/support/topic/hidden-fields-wrapper-change/#post-18818084)
 * Status: not a support question