How to Add a Search Engine With Google Custom Search

Home >> Website Additions >> Adding a Search Engine to Your Site

There are two ways to add a search engine to your site:
1) Outsource a pre-created script

2) Install your own script

Just like anything else, there are advantages and disadvantages to both methods.

Outsourcing a Search Engine

If you outsource a search script, you don't have to worry about installation or configuration. 

Usually you just paste a few lines of code into your site and the site that hosts your search function may allow you to customize the search result page.

The downside to outsourcing is that you don't have complete control of how the search function works and how it is displayed on your site.  You also may have to put up with advertising on the results page.

I have actually chosen to outsource my site's search engine.   I used to use a company called, but now I use Google Custom Search because it's so much easier to setup. 

How to Create a Google Custom Search Engine

If you're a visual person, you can watch the video below where I show you how to set the search engine up. If you'd rather follow text, instructions are below the video.

First go to the GCS site. Now select New Search Engine.

Create new search engine

Fill in all the details about your search engine in the forms provided and choose which edition of the search engine you want to use. (Standard or Site Search).

Click Next.

Select the style of search engine you want.

google custom search style

If you choose a custom style, you can select the look and feel you want so it matches the theme of your website.

Be sure to click the various tabs so you can set design defaults for all parts of the search engine (results pages, ads, etc.).

Now click Next.

Grab the code that you will paste on the page where your search results will show.

Now you may be wondering about the search box. For whatever reason GCS defaults to the results-only format.

In order to get the code for the actual search box, you need to click the basics link below the code and select the "Look and Feel" link on the left side of the page.

gcs basics

gcs look and feel

Now select the Two Page style where the search box will appear on one page and the results will appear on another.

gcs two page

This will allow you to get the code for the search box and the code for the results page.

Creating a Results Page

Before you can use GCS, you need to create a page for the results.

If you're using WordPress, you can create a new Page. There are complete instructions for how to do this in the video above, so it will probably be easier to watch the visual due to all the steps involved.

If you do not use WordPress and have a static HTML site, you would just create a blank template page for your site and paste the results code in the place where you want the results to appear.

Inserting the Code Into Your Site

Once you have the code you need, place them in the appropriate sections of your site.

For example, if you use WordPress, you can use a Text widget to paste the search box code. Don't forget to follow the instructions and also place the required javascript in the <head> of your blog as instructed.

gcs paste code

Most WordPress themes allow you to edit the <head> section of your site in the main Main Settings area of your theme. The Genesis themes definitely do. If you don't do this, your search box may not work.

Be sure you follow the instructions carefully so your search engine will work properly.

Another Option

If the above option seems to complicated, you can also setup your search engine directly through Google AdSense (if you are a member).

When you're logged into your account, go to My Ads >> and select New custom search engine.

gcs Adsense

Check out Ileane's video that shows you how to use this option.

Monetize Your Engine With Google Ads

If you are a member of AdSense, you will earn money if your visitors click on the ads that display alongside your search results.

In the video above I show you how to sync your account with AdSense. Or if you use Ileane's method above, your account will already be synced when you create your engine.

Installing Your Own Search Engine Script

If you do a Google search for "search engine script", you can find tons of sites that offer free search engine scripts.

Most of them are written in Perl/CGI or ASP so they do require you to know a bit about configuring scripts and uploading files.

Even though the search engine script is already written you still need to install it on your web server.  This may require you to get some information from your web host because the scripts usually ask you to input certain information regarding your host.

If you have a basic understanding of installing scripts then you shouldn't have a problem.  However, if this intimidates you I'd recommend outsourcing a search function like I did.

The other downside to installing your own script is they can take up a lot of system resources. In my opinion, it's just easier to use Google Custom Search.

For a listing of search engine scripts go to

If you liked this, please share. Thanks!