google search script code

Google Search Script

Google Search Script

Google search script for sites is an easy and effective way to add search capabilities to your site. The only issue is that google search has ads and for an ad-free search, experience, click here.

Create your own search script using Google :

  1. visit google custom search: search script
  2. Sign in to Custom Search Engine using your Google  Account
  3. After sign in, go to “” to create a new search search script
  4. In the site to search input box, mention your site ( ex. Also, you can mention a particular URL path, so that all URLs under that path will only be searched, ex. You can also use the regex pattern for the URLs to be searched. If you need all the subdomains to be searched, you can mention it. ex. * which will cover all subdomains for searching. By default, the name of the search engine will be the domain name, which can be changed under the “Name of the search engine” input box. Click on “create”, so that a custom search engine for all the URLs mentioned will be created search script
  5. As shown above, the Below options are shown:
    1.  Add it to your site: This step will be for obtaining and adding javascript code to your site.
    2.  View it on the web:  This is a public URL, upon opening, will show the search demo built on top of the Google search index.
    3.  Modify your search engine: This is for modifying search settings. “View it on the web” link will show the demo of the search as a preview. If you modify any settings, you can visit this URL and get a search demo search script
    4. “Modify your search engine” consists of various settings such as search layout, themes, search box customization, and thumbnail(image), promotions, refinements, autocomplete, etc.
google search script

Google search settings

Adding Google Search Script:

google search script code

google search script code

Once you have done changes, save settings and get the code in the “look and feel”  settings tab by clicking on “save & get code”. You can see where to put this code inside HTML page, by clicking “See HTML Example” button. Generally, this piece of code is kept where the search box needs to be shown to users. Note that, search on your site is powered by this simple piece of code. So on your preproduction site, you can see this integration and roll out to production very easily. And search using google search script should be live on your site.

Advantages of Google search script:

  1. Get results for Web, Images, Videos, News, Files, and Weather
  2. Easy to setup

Disadvantages of Google search script:

  1. Google will show ads in the search results. So sometimes customers may see ads of your competitors on your site itself.
  2. Gets difficult to manage look-and-feel as per your website theme

If you are looking for an ad-free google search script alternative, you can sign up with ExpertRec search script.

ExpertRec Search Script:

  1. head on to
  2. Enter your site URL
  3. Add Sitemap URL ( if present)
  4. Get the Expertrec Search Script code and add it to your site

User Interface for this integration is highly customizable and can be modified to match your site theme easily. ExpertRec Custom Search code explains more on this.

Google Search Script is a powerful script to create your own search engine based on Google. With this script, you can instantly get results for Web, Images, Videos, News, Files, and Weather. But Google will show ads in the search results. As an easy alternative, you can try Expertrec Site Search.

ExpertRec Site Search


Leave a Reply

Avatar placeholder

Your email address will not be published.

You may also like