Here are easy steps to create an internal website search script for your website.

  1. Go to Expertrec custom search engine login page.
  2. Create a custom search engine.
  3. Login with your Gmail id.
  4. Enter your website URL.
  5. Enter your sitemap URL.
  6. Choose your nearest data center.
  7. Initiate your website crawl.
  8. Wait for the crawl to complete.
  9. Copy the internal website search script code and paste it to your website.
internal website search script

Every website needs a search bar to make a Content searchable present on it. This content can be about the company, documentation, support pages, forums, product descriptions, blogs to locations, etc. Many of the webmasters work to improve their Google/Bing search results ranking, but they overlook their internal website search and its capabilities. How easily users are going to find information on your site? Internal website search is a key factor in user experience, feedback on different content on site, optimizing site organization, etc. Once your site grows in terms of content, visiting users; it becomes trivial to have a good search bar that will not only respond to user queries but also guide them to find what they are looking for. The best internal search for sites is easy to implement and low cost to run and manage.

internal website search script

Importance of Internal website search script:

First of all, what users are going to search on Google/Bing verses on your site are very different. If users are searching on your site it does mean they have spent time on your site, they are interested in your site and maybe for an e-commerce site its the journey to buying products and more importantly what is it they are interested in. This is the importance of having an internal website search.

What is an Internal website search script?

A simple free text search bar on top of your website which can handle user queries and guide them to find content easily what they are looking for. A visible search bar in the top(header) section of your website and search service responding to users queries are the main components of Internal Website Search.

Internal site search solutions:

If your site is based on any Content Management System (CMS), then the search functionality is handled by CMS by default. As most of the CMS support plugins to enhance their functionality, a third party or community-based plugin can be used for the search features. You can still implement a powerful custom site search provided by existing search engines like Google, Bing etc. An internal site search for a static website is also possible and can be implemented easily. Additionally, you can also build search functionality from scratch.

Internal site search script:

You can implement a custom site search provided by remote search providers like Google, Bing etc. This integration is done by adding a javascript code to the HTML source code of web pages. This javascript code is usually added to the place where you want the search bar to appear. GoogleBing provides free search bar for your website.

Ex. 1. Search Script for using the custom search provided by Google:
  (function() {
    var cx = 'google-custom-search-engine-id';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src = '' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
Ex. 2. Search Script for using custom search provided by Expertrec:
(function() {
var id = 'Expertrec-custom-search-id';
var ci_search = document.createElement('script');
ci_search.type = 'text/javascript';
ci_search.async = true;
ci_search.src = '' + id;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ci_search, s);


Above code should be copied to a <div> element in your site’s <body> section, where you want both of the search box and the search results to render.

After the addition of the javascript code to the source HTML code of the web page, it will have a search bar to handle search queries and display them accordingly. More on this is covered in Google custom search, Bing custom search, Expertrec custom search.

In summary, Search functionality is at the center in this digital world. People are going to interact with your site and it should be easy to find what they are looking for in their terms. Internal site search is a must-have feature as content and users of your website grow. There are numerous options as discussed above while adding site searches to the website.

Create Internal Website Search using ExpertRec

Happy Searching…!


govind dhonddev

Govind Dhonddev is a Software Engineer at ExpertRec, who loves coding, food and writing blogs.

You may also like