With the introduction of Web Speech API to Chrome and Firefox, it’s never been easier to offer voice input on your website’s search (or any other input element). In this article, we are going to implement the mechanics of a basic voice search using the Speech Recognition API.
It’s exactly what it says on the tin, a search triggered by a voice command. That’s it! It’s that simple.
Offering voice search on your website is not only great for accessibility, especially for those with physical disabilities who find it hard to use a keyboard, it can also play a key role in increasing conversions on e-commerce stores. By making it quicker for users to input a search, voice search can reduce the time it takes for potential customers to find what they’re looking for.
The rise of home assistants such as Amazon’s Alexa and Google are normalizing voice-based interaction with software. By offering a similar experience on your website you’re providing a familiar interface for new users that is ahead of the curve and ultimately – cool.

This article will take you through a simple HTML and JS implementation, however, this can easily be added to an existing framework such as Magento or WordPress with a little modification. If you have basic coding knowledge, pass this over to your web developer, they’ll know what to do. We have packaged our code up too – you can swipe it from the bottom of this article.
Let’s start with a simple HTML template with a basic search form. I’ve created this in a PHP file so we can post form data.
Nothing particularly complex here, just a form with a search input and a microphone icon. Some simple CSS styling is added in style.css…
Now on to the JS, this is where we hook up the Web Speech API to our input. There are a couple of nice features in here, for example, hiding the voice search icon if the browser doesn’t support the API and also adding a CSS class to show when the voice search is active.
Hopefully, this has shown how easy it is to implement voice search, and also what a great method of user interaction it can be.
Let us know how you get on implementing the above, or whether you have added further customisation – we’d love to hear all about it!
Reach out to us on Twitter @big_eye_deers.
Formerly known as Magento, Adobe Commerce is built for complex catalogues, integrations, and long term growth. We design and develop stable, scalable stores that support demanding eCommerce requirements, including multi-store setups, complex pricing, and Hyva based performance improvements.
We design and build custom eCommerce platforms for businesses with complex workflows, integrations, or non standard requirements. Built from scratch around your business needs using Laravel and modern architectures.
Working with brands across the UK from our offices in Cardiff and Exeter, you deal directly with a senior team of designers and developers specialising in Shopify, Magento, WordPress and bespoke eCommerce platforms.
We focus on commercial outcomes. Better conversion rates, strong SEO foundations and eCommerce platforms that continue to improve long after launch.