Skip to main content

30 steps to a more accessible website

Step 29: Making everything searchable

Every website needs a site search. Period.

Rules for a good site search:

  1. Put the search box on every page, preferably "above the fold" (visible without scrolling).
  2. Search everything by default. If you have an option to search entries, comments, or both, make "both" the default.
  3. Don't clutter your search box with advanced options, like boolean logic, case sensitivity, or regular expressions.
  4. Choose defaults that mimic Google's behavior (match all words, don't match partial words, don't match case, don't use regular expressions) and make all the options visible on a separate "advanced search" page.
  5. Give your search box a proper label and an access key. I recommend accesskey="4" .

(Note: On step 15, I gave an example of how to assign an access key to your search form, and I got it wrong. For maximum cross-browser compatibility, you need to define the accesskey on the <label> , not on the <input> . See the examples below for the correct syntax.)

Who benefits?

Jackie, Michael, Bill, Lillian, Marcus, and pretty much everyone else in the world benefit from a well-implemented site search. Especially on a weblog or news-oriented site, where content is primarily organized chronologically, it's very frustrating to try to find a specific post that's scrolled off the main page. Very few people know about the "" syntax on Google (to restrict search results to a particular domain), and Google only reindexes once a month anyway. Provide your own site search.

Further reading

« Step 28: Labeling form elements | Contents| Step 30: Creating an accessibility statement »

This guide is adapted from Dive Into Accessibility by Mark Pilgrim and is shared with the GNU Free Documentation License v1.1