Skip to Content

Adding a Filter to your Search Input using Bootstrap


In this article, we teach you how to add a category filter to your site search to provide more relevant search results to website visitors.

Search on the web has gone far beyond simply going to search engines to find information. In order to dig deeper and find content more relevant to search queries, website visitors are increasingly searching through actual websites themselves for that right piece of content they're looking for. To take that a step further, it is possible to add filters to your search inputs so your website visitors can further specify the content they are looking for. This allows you to deliver a better web experience that provides the visitor with the content they are looking for at a much faster rate.

In this tutorial, we will teach you how to add a category filter to your search input to provide more relevant search results to website visitors.

Below is the HTML, CSS, and JavaScript required.

Step 1 - search-filter.html

Copy and paste the following code into search-filter.html


Step 2 - search-filter.css

Download the CSS below and include it in your web page

 search-filter.css

Step 3 - Add the following includes to your web page


Matthieu McClintock
Contributions Editor here at Solodev. Want to be featured on the Solodev Blog? Get in touch.
Follow me on Twitter

Sign up to explore

Create an account in seconds and start building today.

Sign up for Solodev