Make WordPress Core

Opened 14 months ago

Last modified 4 weeks ago

#63971 reopened defect (bug)

Multiple select elements associated with tables in the admin (filters, user role changes) lack visible, persistent labels

Reported by: alh0319 Owned by:
Priority: normal Milestone: 7.2
Component: General Version:
Severity: normal Keywords: a11y-task a11y-visible-labels has-patch has-unit-tests
Cc: Focuses: ui, accessibility

Description

Throughout the admin, there are select elements that have labels hidden with screen reader text and that rely on the default or first option in the select to provide a visible label.

Here is an example, filters for the posts table:

<div class="alignleft actions">
				<label for="filter-by-date" class="screen-reader-text">Filter by date</label>
		<select name="m" id="filter-by-date">
			<option selected="selected" value="0">All dates</option>
		<option value="202508">August 2025</option>
		</select>
		<label class="screen-reader-text" for="cat">Filter by category</label><select name="cat" id="cat" class="postform">
	<option value="0">All Categories</option>
	<option class="level-0" value="1">Uncategorized</option>
</select>
<input type="submit" name="filter_action" id="post-query-submit" class="button" value="Filter">		</div>

​See image of post filters missing visible lables.

Other places that this technique has been used include:

  • Bulk actions select
  • Change user role select
  • Media filters
  • Comment filters

​WCAG 3.3.2: Labels or Instructions (Level A) requires that labels or instructions be provided when content requires user input. This is generally interpreted to require visible and persistent labels.

In the current implementation, once a user has selected an option in the select, there is no longer a visible label for the select. It is posisble for users to link directly to filtered versions of these tables which would pre-fill the select with a date or category, for example, in which case any user following that link would not have access to the label for the select.

It is worth noting that to receive the accessibility-ready tag for a theme, we require all inputs and form fields to have visible and persistent labels. This technique in the admin would fail an accessibility ready review were it followed in a theme.

In addition, these fields also fail ​2.5.3: Label in Name (Level A), as the visible text for the first option (or any selected option) does not match the label.

Example: The hidden accessible name for the date filter select is "Filter by date" and the visible text is "All dates" or any selected date, such as "August 2025".

This mismatch between the visible text and the label would make it difficult for users who rely on voice control to interact with these fields.

The admin UI should be reworked so that selects have visible labels that don't rely on the default option in the select.

Change History (12)

#1 @joedolson
14 months ago

  • Keywords a11y-task added

This is an existing task that's been getting very slowly worked through across the admin. But there's a lot of these, and it's slow going.

This ticket was mentioned in ​Slack in #accessibility by joedolson. ​View the logs.


14 months ago

#3 @joedolson
14 months ago

This is significantly overlapping, though not a 100% duplicate of #63728. I think it would be better to make these tickets more focused, and refer specifically to a particular set of issues.

Probably makes sense for this to be considered a task with associated issues; can you open new tickets for the user role filters and comment filters?

Media filters are already covered by #47137.

This ticket was mentioned in ​Slack in #accessibility by joedolson. ​View the logs.


12 months ago

#5 @joedolson
12 months ago

  • Milestone Awaiting Review → 7.0

Also related: #47359

#6 @joedolson
12 months ago

  • Milestone 7.0
  • Resolution → duplicate
  • Status new → closed

Duplicate of #63728.

This ticket was mentioned in ​Slack in #accessibility by joedolson. ​View the logs.


5 weeks ago

#8 @joedolson
5 weeks ago

  • Milestone → 7.2
  • Resolution duplicate
  • Status closed → reopened

The visible label issue has been removed from #63728, to allow that ticket to focus on the complicated author dropdown performance issue. Reopening this ticket to address visible labels.

#9 @afercia
5 weeks ago

  • Keywords a11y-visible-labels added

#10 @sanket.parmar
4 weeks ago

Proposed first patch, scoped to keep it reviewable:

  • Visible, persistent labels for the Bulk actions, date, category and format selects on the Posts screen, using the layout in labels_1.png​ (per comment:21:ticket:63728).
  • Bulk actions and the date filter are rendered by WP_List_Table, so other list tables pick those up too.
  • Builds on the label changes in ​PR 10887 (props @Vedanshmini26), leaving the author dropdown to #63728.

The user role, comment type, link category and Media list view selects would follow as separate patches.

This ticket was mentioned in ​PR #14201 on ​WordPress/wordpress-develop by ​@sanket.parmar.


4 weeks ago
#11

  • Keywords has-patch has-unit-tests added

Makes the select labels in list table toolbars visible and persistent: Bulk actions, date, category, post format, comment type, change role, media type and link category. Each label and its select share a .tablenav-filter wrapper, and the toolbar groups wrap as flex rows, so a label never separates from its select and the Filter button stays last on screen and in tab order.

Also restores the Links filter label, empty since 5.7 because link_category had no filter_by_item label. Builds on the label changes in #10887 (props @Vedanshmini26). Plugins adding visible-label filters through restrict_manage_posts can use the same wrapper.

  • [x] npm run test:php -- --group admin,taxonomy,link (single site and multisite)
  • [x] Posts, Media (list view), Users, Comments and Links at 1512px, 1024px and 760px: labels beside their selects, wrapped rows spaced, Filter button last
  • [ ] Screen reader: each select announced with its visible label
  • [ ] RTL

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Investigating the affected list tables, drafting the patch and tests, and layout checks across screen widths; reviewed and tested by me.

#12 @sanket.parmar
4 weeks ago

​PR 14201 now covers all the list table selects, including user role, comment type, link category and the Media list type filter, so no screen is left with only some selects labelled (comment:6:ticket:63728). It also restores the Links filter label, empty since 5.7.

Note: See TracTickets for help on using tickets.