Relevanssi Premium’s Voice Search lets visitors enter a search query by speaking into their microphone. The browser converts speech to text, and the resulting text is used in the site’s search form. Visitors can still type and submit searches normally.
The feature uses the browser’s SpeechRecognition API. Availability depends on the browser, device, language, and permissions; it is not a guarantee that speech recognition works in every browser.
How to enable Voice Search
Open Relevanssi > Settings > Display & UI and find Voice Search. Voice search is disabled by default. The three controls are:
- Voice search: enables the microphone interface for supported search inputs.
- Voice search autosubmit: submits the associated form when the recognition session ends and the input contains text. Disable it if visitors should review the text before submitting.
- Voice search CSS: loads the default styles for the microphone interface. Disable it if you need to supply your own styles.
Save the options, then test a search form on your site’s frontend. No index rebuild is required to change these interface settings.
Browser support and permissions
Use HTTPS for a public site and test the actual browsers and devices your visitors use. Browsers may restrict microphone use in insecure contexts; local development hosts can be treated differently. HTTPS alone does not guarantee support.
Relevanssi checks for SpeechRecognition or webkitSpeechRecognition. If neither is available, it does not add the microphone interface. Check the current browser compatibility information rather than assuming that every version of a browser supports the same recognition features.
The visitor must permit microphone access. The plugin uses the site’s language setting for recognition; support for that language depends on the browser’s recognition service and, for local processing, the available language resources.
Privacy and local processing
When the browser exposes the processLocally capability, Relevanssi first requests local recognition. If that attempt reports language-not-supported, the plugin retries with local processing disabled. In browsers without that capability, it uses the browser’s normal recognition mode.
Recognition may therefore send audio to a service used by the browser. Relevanssi does not guarantee offline operation or exclusively local processing. Explain the feature appropriately in your site’s privacy information and assess the browsers and services used by your audience before enabling it.
Search form integration and styling
On page load, the script looks for inputs matching input[name="s"] or input[type="search"], wraps them, and adds a microphone button. A custom field that matches neither selector, or a form inserted later by JavaScript, is not automatically covered by this initial setup.
The default stylesheet includes rules for common search layouts, including Gutenberg and Elementor forms. Your theme may still need adjustments. These classes are useful for custom styles:
.relevanssi-voice-search-wrapper: the wrapper around the input and button..relevanssi-mic-button: the microphone button..is-active: a state class applied to the button during an active recognition session..is-talking: a state class applied when the browser reports speech activity.
If Voice Search does not work
- No microphone button: check that Voice search is enabled, the browser exposes the recognition API, and the search input matches a supported selector at page load.
- Microphone access denied: check the site’s microphone permission in the browser and the device’s permission settings. Relevanssi disables the button after a permission or network error; reload the page after resolving the cause.
- No connection or unsupported language: check the browser’s recognition service, network access, and language support. A supported API does not guarantee that its service is available.
- Text appears but the search behaves unexpectedly: disable autosubmit while checking the form’s own submission behaviour, especially for custom Ajax forms.
- The icon overlaps other controls: check the theme’s layout and adjust the styles, or disable Voice search CSS and provide your own.