Having some sort of search functionality on your website is crucial, especially if you have many pages.
In this case, good navigation may not be enough to ensure optimal user experience.
People need to be able to find the content they are looking for without having to click too many times.
Fortunately, it is very easy to add a search box or search bar to your site.
Most content management systems and website builders even offer built-in search functionality.
But there are also several more powerful solutions available, such as using a Google-powered custom search engine.
Google Custom Search
You can easily create a custom Google search box and publish it on your site.
If you have a Google AdSense account then you can even earn revenue from the clicks on the ads in your search box.
You can make it search a specific site, several different sites or even the web as a whole like I do on my Ask Google page.
Here’s what it looks like:
In addition, you can choose whether to show the search results on your own page or redirect searchers straight to Google.
Here are 7 steps to add a custom Google search box to your site:
- Open this page in your browser: https://cse.google.com/cse/
- Click “Sign In to Custom Search Engine”
- Log in with your Google account
- Enter your site and give your search box a name
- Click Create
- Click Get Code
- Now copy the code and paste it into your site
Here’s what the sample code looks like:
Now you can paste the code into your site, such as in a Custom HTML widget in WordPress, and it will show the search box.
You can make several changes to your custom search engine in the menu on the left:
- Change where to search, such as your site only or the entire web.
- Link your AdSense account to get revenue from the ad clicks.
- Connect your Google Analytics account to get data about how the search box is being used.
- Adjust the look and feel of the box and search results.
I recommend that you play around with the settings until you are happy with the way it looks and functions.
WordPress is the world’s most popular website software, currently powering a whopping 33% of the web.
If your site is using WordPress then it does have a built-in search bar, which you can add with a widget.
Here’s how to add a search bar in WordPress:
- Log in to your WordPress dashboard.
- In the menu, click Appearance -> Widgets
- Drag the widget called “Search” to where you want it, such as your Sidebar.
- Add a title for the search bar if you want.
Some themes offer the ability to embed the search box into the navigation bar. This looks much nicer.
Unfortunately, the built-in WordPress search functionality is not very good. But you can easily make it much better by installing free plugins.
Other Search Options
Every popular website platform offers some sort of search functionality.
If you are using Joomla, Magento, Wix, Squarespace, Shopify or any other popular tool to build your website then you should be able to find a good option.
You can easily find info about this on Google. If you’re using Joomla, then try typing “Joomla search box” into Google to find instructions.
Here are a few additional third-party providers you can use to add a search function to your site:
- Bing – Add a custom Bing search engine.
- DuckDuckGo – This box redirects to the search results on DuckDuckGo.
- FreeFind – Another third-party search provider that some sites use.
To sum up, there are many different ways to add a search box to your website.
Out of the ones mentioned above, the Google Custom Search option is the most powerful.
By linking your Google Adsense account, you can even get paid for the clicks on the ads in the search results.