Skip to main contentSkip to footer

Modern search is about accessibility and speed. Relevanssi now includes a Voice Search feature that allows your visitors to search your site using their microphone. Instead of typing, they simply click a microphone icon and speak their query directly into the search bar.

This feature is powered by the Web Speech API. It is a “progressive enhancement” feature, meaning it stays out of the way if a browser doesn’t support it, but provides a high-end experience for users on modern browsers like Chrome, Edge, and Safari.

How to enable Voice Search

Voice search is disabled by default. You can enable it from the Relevanssi settings page under the “Searching” tab. There are three main controls for this feature:

  • Voice search: Toggles the microphone icon on or off for all search forms on your site.
  • Voice search autosubmit: If enabled, Relevanssi will automatically trigger the search once the user stops talking. If disabled, the text will stay in the search bar for the user to review before they manually click search.
  • Voice search CSS: This enqueues a small stylesheet that positions the microphone icon inside your search bar. If your theme has a very unique layout and the icon looks misplaced, you can disable this and provide your own CSS.

Privacy and Local Processing

Relevanssi prioritizes user privacy by attempting to use on-device speech processing first. If the user’s device has the necessary language packs installed (common on modern mobile devices and macOS), the audio never leaves the user’s computer.

If local processing isn’t available, the browser will automatically fall back to a cloud-based recognition service (such as Google or Apple). This ensures that voice search works reliably across as many devices as possible.

Customizing the look

By default, Relevanssi attempts to place the microphone icon inside the right edge of your search field. It includes specific overrides for Gutenberg Search Blocks and Elementor search forms to ensure a perfect fit.

If you wish to customize the appearance, you can use the following CSS classes in your theme:

  • .relevanssi-voice-search-wrapper: The container around the search input.
  • .relevanssi-mic-button: The actual microphone button.
  • .is-active: A class added to the button while it is “listening.”
  • .is-talking: A class added when the API specifically detects a human voice.

Browser Support

Voice search is currently supported by Chrome, Edge, and Safari. Because the technology requires a secure connection, voice search will only appear on sites running over HTTPS. Here is the list of compatible browsers.

Note on Firefox: As of now, Firefox does not support the Web Speech API. Relevanssi detects this and will silently hide the microphone icon on Firefox to ensure your site layout remains clean and consistent for those users.

Your account

Not logged in. Log in to see your license details.

Search

Popular Resources

Events Calendar: Remove past events from search

…= false; } } return $status; } /** * Removes past events from indexing. * * @param array $restriction The MySQL restriction and an explanation. * * @return array The restriction set with event restriction included. */ function rlv_exclude_past_events( $restriction ) { global $wpdb; $restriction[‘mysql’] .= ” AND post.ID NOT…

WooCommerce: Popularity and price sorting

Many WooCommerce users use search sorting that allows users to sort by popularity or price. Unfortunately, while Relevanssi works fine with WooCommerce, those sorts do not work. Relevanssi doesn’t know about price or popularity, and the sorting assumes there’s a default WP search underneath. Relevanssi doesn’t do meta field sorting…as easily as the default WP search does. This function handles price, popularity and rating sorting: add_filter( ‘relevanssi_orderby’, ‘woocommerce_relevanssi_orderby’ ); function woocommerce_relevanssi_orderby( $orderby ) { if ( in_array( $orderby, array( ‘price’, ‘price-desc’ ), true ) ) { global $wp_query; $orderby = ‘meta_value_num’; $wp_query->query_vars[‘meta_key’] = ‘_price’; } if ( ‘price’ ===…

BeTheme
BeTheme does the strangest, weirdest, and least productive things with search I’ve ever seen in a professional theme. It can…

Related Posts:

Comment Section:

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed