How to Embed the Google Search Bar

By Kevin Lee

To remain competitive, your website needs to not only attract visitors, but keep them there as well. One way to do that is to give site visitors the ability to search the contents of your website. You may not be able to build a search engine that competes with Google's, but Google will let you use its search technology for free. Simply visit its site, create a search engine that searches your site and embed it in your HTML pages.

Step 1

Visit the Google website listed in Resources. This is where you will build a custom search engine (CSE).

Step 2

Click "Create a Custom Search Engine."

Step 3

Enter your User ID and password to log on to your Google account.

Step 4

Enter a name for your search engine and a description. The description is optional, but it will assist you in identifying the search engine in the future.

Step 5

Enter the URL of your website in the "Sites to search" text box.

Step 6

Put a check mark next to "I have read and agree to the Terms of Service." Click "Next." You will see a list of search engine styles that include "Green Sky," "Shiny" and "Minimalist." Click one of the styles to select it.

Step 7

Click "Next." Copy the HTML code that you see in the text box.

Step 8

Open your HTML page using Notepad or an HTML editor.

Step 9

Paste the code in the

section of the document where you want your search bar to appear.

Step 10

Save the document and open it in your browser. Type a search query, and Google will return results from your website.

Tips & Warnings

  • You cannot use Google in the name of your custom search engine. Google also suggests not using trademarked names without permission.