Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#52414 closed defect (bug) (invalid)

Accessibility checker flags search form

Reported by: tylertork's profile TylerTork Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Widgets Keywords:
Focuses: accessibility Cc:


Using "" to test accessibility of a WordPress site, I got the following warning regarding the core Search widget:

Check 57: input element, type of "text", missing an associated label.
Repair: Add a label element that surrounds the control's label. Set the for attribute on the label element to the same value as the id attribute of the control. And/or add a title attribute to the input element. And/or create a label element that contains the input element.

The HTML it flagged was:

<input type="text" name="s" class="form-control" placeholder="Search">

Could we please add a title attribute as suggested by the testing tool?

Change History (2)

#1 @SergeyBiryukov
3 years ago

  • Component changed from General to Widgets
  • Focuses accessibility added

#2 @sabernhardt
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

@TylerTork Thanks for the report!

The accessibility checker indicates that there is no label for that search input. The standard core search widget markup does include a label tag with text in it.
See general-template.php

Unfortunately, the Graphene theme overrides the standard form markup in its searchform.php template file and does not supply a label. The WAVE evaluation tool also flags missing button text for the submit button.

You could report these accessibility errors in the theme's support forum. Because this is not a core bug, I'll close the ticket here.

Note: See TracTickets for help on using tickets.