Easy Code to Add Google Site Search to Your Website
By Stephen Bucaro
If your website consists of more than just a few pages, it's important to have
a way for your visitors to search your website. There are several ways you can
accomplish this. One way is to use a pay site search company which will index
your site's contents and provide you code for a search box. This may give you
more control over the results returned for a specific search term or phrase.
The down side is, you have to pay.
Another way to put site search to your website is to create your own index of
your site's contents and write your own search program. This gives you complete
control over the results returned. The down side, it's very complicated to write
code that can create an index and return results from that index based upon
a specific search term or phrase.
Another way is to simply put the code for a search box that calls the search
program of one of the major search providers, like Google. Google is the king
of search providers, garnering 90 percent of the market according to statista.com.
So when your visitors see a Google search box on your site, it will be a familiar
item. The down side is that Google is in the search business to make money,
so there will be some not from your website results returned with your
Some authors will tell you that you need to have an account with Google
in order to create a Google Site Search box. This is entirely untrue. If you want
to earn a commission when someone types certain specific terms or phrases into
your search box, then you need an account with Google's Adsense program.
However, not everybody is accepted for the Adsense program. And you're going
to get paid for searches of your own website.
The code for Google site search is shown below, just paste this code into the
desired location on your website.
<form method="get" action="http://www.google.com/search">
<img src="http://www.google.com/images/poweredby_transparent/poweredby_FFFFFF.gif" alt="Google" />
<input type="text" name="q" size="30" maxlength="255" valu="" />
<input type="submit" value="Search Site" />
<input type="hidden" name="sitesearch" value="http://bucarotechelp.com" />
One thing you'll want to do is replace the link "http://bucarotechelp.com" with
the URL of your website (unless you want to post a form to search my website.
In that case thank you.) And just above that you may want to replace the
"Search Site" with Search (the name of your website). Or just leave it "Search Site".
After you make those modifications, type in a search term or phrase and give
it a test. You can's get the services of a powerful search engine on your website
any easier or cheaper than this.
More HTML Code:
• Wrapping Text Around Images
• Use Meta Tags for Search Engine Optimization
• Providing Alternate and Title Text for an Image
• The Font Tag
• HTML Image Basics
• Creating a Subscript or Superscript with HTML
• Aligning an Image on Your Web Page
• HTML Select List Basics
• Divide a Table Into Head (thead), Body (tbody), and Footer (tfoot) Sections
• HTML center Tag