How to add a search bar?


How we can add a search bar in Jekyll website.


See these tutorials on search from CloudCannon:


Here is an example of a super simple site-search (using Google):

<form method="get" action="" target="_blank">
<input type="hidden" name="sitesearch" value="" />
<input type="text" name="q" maxlength="255" placeholder="Search with Google" />

Note that the domainname needs to be changed (currently ‘’). See the full code at: The live website can be found here:


You can use a Javascript search like lunr.


i have made a search feature for a Jekyll shop. using this method shown here


So, if we add the search bar on what basis it will show the search results?

On the basis of category or tags or keyword?


On build it will build an xml file to search… I used a bit of ymal call search terms


I have tried to add the search bar. But it didn’t go well.

Is there any other option?


Have you looked into Algolia?

There’s a Jekyll plugin to auto-sync data from a standard Jekyll blog (link).

If you’re doing more than a blog, a quick search on Github will pull up a number of results (including a few I’ve made over the years). I’d recommend starting with their instantsearch library.