How do you create custom Search Boxes that have built-in keywords, limits to
particular sites or a particular look and feel? Even without using Google’s
custom search feature, you can compose a custom text-link search with the search
keywords built-in so the person only has to click like this: Google Easter search which looks in
HTML (Hypertext Markup Language) like this:
<a href=https://www.google.com/search?q=rabbits+eggs>Google Easter
search</a>You can make up a link to any search you want
just by typing it on in the Google command line, then pasting the
URL (Uniform Resource Locator) Google converts it into as the href, converting every
& to & (possibly by
You can also set up a search box form where the user
types the search keys, where it searches only your site. See these examples.
You want Custom Search not SiteSearch. SiteSearch is quite expensive and entails installing search
engine software on your server. SiteSearch gives up to the second relevancy since you
don’t have to wait for Google to spider. It is intended for businesses.
Google has a scheme to make it easy to set up custom searches just by asking
questions on their website. The features include:
- with ads or paid, but ad-free
- narrow the search to a particular website or websites.
- narrow the search to particular web pages or directories.
- salting the search with generic keywords.
- The links you now insert are much shorter and simpler and pass validation, with
the exception of a pair of nugatory <div> tags
and a dangling & that should have been encoded as
- You can choose to have the result appear on your own web pages, or on a Google
page as is traditional.
- You can have the search button hosted on Google if you are don’t know how
to insert HTML into your own web page, e.g. if you are a
- When you create your site search they don’t give you the
paste into your site, leaving you to wonder if search pages must be hosted at
google. There is no mention where to look under help. It turns out they
later email you a link to it, but they don’t tell you that or mention it
anywhere in the FAQs (Frequently Asked Questionses). Look for the email in your SPAM bucket. Later you
can find it under code on the control panel.
- General big brotherness. Google maintains control and in theory could make the
links you put on your website do anything it pleased.
This will rule out some of the less popular browsers.
- You can’t let the client choose with a radio button whether for example
to search the web, Oracle’s site or your site.
- You can’t set up searches to Google images or Google groups.
- There is nothing in the generated HTML
that gives any hint as to what search engine does. It is up to you to add your own
comments to help keep track.
- If you put two different searches on the same page, you must manually modify
the id of each search to make it unique.
complicated. I deliberately use simpler out-of-date scripts on my site. Ideally, I
with some Wireshark hacking I could
figure out how to do it.
- I use a markup style two or three versions out-of-date because:
- It is much faster.
- It lets me label the submit button.
- It lets me control the size of the search box.
- The text you type in aligns properly. Some ditzy artist at Google thought
it would look kewel to have the search text hanging out the bottom of the
At some point Google will drop support for my style and I will have to
improve my markup.
New Style Custom Search
In the new style custom search, you have many more options, but you don’t
specify them in the HTML. Your selections remain on file with Google. This
leads to simpler HTML to invoke, but it also gives Google more control over
what you do.
The CMP (Canadian Mind Products) search box above is generated with the following
Here is a typical example that searches just http://mindprod.com/kjv where the text of the King James bible is
Search King James Bible
To search The King James bible for an exact phrase, enter it in quotes, e.g. "hand of the poor and needy"
To search for words used together in a chapter, enter the words without quotes e.g. wrestled angel Jacob
Here is the HTML for the search box:
Note there is no reference to kjv or mindprod.com in it anywhere. The 005260666645288681202:f8um2hwp-ho is a reference to the information
about the search stored on Google. That snippet would thus work on any website.
You can safely modify the line:
<input type="text" name="q" size="55">
to increase or decrease the size of the box you fill in.
You can safely modify the line:
<input type="submit" name="sa" value="Search Oracle">
To change the text on the search button.