Skip to main content
WCAGrules
Quick navigation

Add a site-wide search function

Search is a route through a site that needs no understanding of how the site is organized. That is why W3C treats it as a way of locating content in its own right. G161 asks for one that indexes your pages. W3C notes that spell-checking the query, handling different word endings, and allowing synonyms all make it more useful, and those details decide whether people find anything. This is a sufficient technique for 2.4.5 Multiple Ways at Level AA, when combined with other techniques, because that rule asks for more than one route and search is one of them. One requirement is ours rather than W3C's, and it follows from everything else. The search box is a form control, so it needs a label, keyboard operation and a results page that behaves, or the route you added is only a route for some people.

How we find it in an audit

Our reviewers run real searches. Misspelled ones, and ones using the words a customer would use rather than the words the site uses. Then we test the interface itself. Label on the input, keyboard access to submit, focus moving somewhere sensible when results appear, and a result count that gets announced rather than only displayed.

How affected users experience it

For a screen reader user, search is often the fastest tool on a site, because hunting a category tree by ear is slow and a query is one action. That advantage disappears when the search box has no label, so it announces as 'edit' with no clue what it does, or when results load silently and nothing says anything happened. Building search and leaving it unlabeled removes the route you thought you added.

Passes vs. fails

Passes: one jump past the header. Fails: tab through everything, every page.

Passes

A labeled search box on every page indexes full article text, giving readers a route to any article without learning the structure.

Fails

A 500-article knowledge base can only be browsed through nested categories, so articles filed unexpectedly are unfindable.

Other ways to satisfy this rule

8 guides on this site are filed under 2.4.5 Multiple Ways. W3C lists this one as sufficient for that rule when combined with other techniques, so the condition is part of the test rather than a footnote to it.

This guide is our interpretation of W3C technique G161: Providing a search function to help users find content. W3C publishes its techniques as guidance rather than as the standard, and says so on every one of them. The success criterion is what conformance is measured against, and a technique is one documented way to meet it.

Go somewhere useful

Find tools, resources and your workspace.

29 destinations