A search bar is necessary for a good website. Creating your own search engine from scratch might be a difficult task but this task can be skipped with the help of Google. Google has created a website to create a custom search bar, to create your own check the below link.
Creating a Custom Search Bar: On this website, anyone can easily program their search bar by just selecting the sites you want to be searched for. Follow the steps explained below.
- Step 1: Go to the following site and hit Get Started button.

- Step 2: Select the New search engine button to create a new search engine.

- Step 3: Fill the details as directed on the page and then click the create button.

- Step 4: After hitting create you will get your code by hitting the Get Code button on the screen shown.

Note: You can modify your setting about searching sites, searching images, safe search from control panel and you can also set to show advertisement while searching through your search bar.
Embedding the Search Bar on a Webpage: After getting your code you can simply paste it inside your web page to see the working search bar.