Some WordPress themes or older implementations of WordPress search widgets are missing labels on search fields. This article explains how Accessibility Checker can help you add labels to unlabelled search form fields in your WordPress site without editing code.
How to Add Labels to Search Form Fields in WordPress
If your website has an unlabelled search field, this accessibility issue can be easily fixed without writing code using the WordPress Accessibility Checker plugin.
Step 1
Click into the Accessibility Checker plugin settings in your WordPress dashboard (you must be logged in with an administrator account to access these settings).
Step 2
Go to the “Fixes” tab in the Settings Tabs navigation.
Step 3
Check the box for Label Search Form, then scroll to the bottom of the page and click the “Save Changes” button.
Note: Automated accessibility fixes use JavaScript or other methods to modify how your website functions. Occasionally, a WordPress theme or extension may conflict with or prevent our fixes from working as expected. We recommend testing these fixes on a local or staging copy of your website first.
Not seeing the fix?
The Label Search Form accessibility fix should start working immediately; however, if you don’t see the fix, it could be because you’re seeing a cached version of your website. Try clearing the cache in any caching plugins and on your hosting account, then look at your site in an incognito window to confirm the fix worked.
Note: Turning on a fix will not instantly remove related issues from Accessibility Checker reports. After turning on a fix, you can clear issues from reports by running a full site scan in Accessibility Checker Pro or by saving any individual post/page to trigger a rescan of that post/page only.
What This Fix Does
When enabled, the Label Search Form fix looks at any search forms generated with the WordPress core get_search_form
filter and checks to ensure that the field is labeled.
If the search field is unlabelled, it will create a visible label for the field with the text “Search for”.
Impact on Accessibility
Search functionality is an incredibly important tool for all users on any website. It is particularly important on websites with large amounts of content. Many people with disabilities, in particular, screen reader users, may rely on search functionality to navigate websites and find specific content or information.
If your search form is not labeled, it will be difficult or impossible for people with disabilities and screen reader users to use. Enabling the Label Search Form fix is a key accessibility enhancement for all users.
Associated Checks
The following checks in Accessibility Checker are associated with this fix: