How do I add a Google Search box to my site that has an option to search my site or the web?

  • 1
  • Question
  • Updated 8 years ago
  • Answered
How do I add a Google Search box to my site that has an option to search my site or the web?
Photo of zane

zane

  • 24 Posts
  • 0 Reply Likes
  • frustrated

Posted 10 years ago

  • 1
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
Peter knows the code for sure - i will try to find it for you. I use Pico serach i find it better as the google search only works if your pages are indexed with google - with pico search you can re index your site any time you like

Lee.
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
Photo of jeremy

jeremy, Employee

  • 1349 Posts
  • 90 Reply Likes
Hi there Zane,

You can add a Google Custom Search Engine to your page. It won't give you the drop-down option I think you are wanting but once you have searched you can then choose Web search.

If you would like to give this a try, here is a link to get started: http://www.google.com/coop/cse/ and some help for setting it up.

1. Click Create Custom Search Engine
2. You will need to follow through the steps to set it up such as a Name, Description and Keywords that describe the content of your site.
3. In the field labeled "What do you want to Search?" click "Only sites I select".
4. If you want this to be a site search to only search your website put in your website address as such: http://mysite.synthasite.com (putting in your domain name).
5. The standard edition is free but will include some Google Ads; the Business Edition is $100 per year and will not include ads.
6. Agree to the Terms of Service and click Next.
7. You will now be able to try out the search engine you have created. Remember, if your site hasn't been indexed by Google, you will not receive any results. After you have tested it click Finish.
8. On this page you will see your Search Engine with three links next to it, Click Control Panel.
9. On this page you will see **Control Panel: Your Search Engine Name**, underneath this click on the link that says Code.
10. You will see a block of html code; please copy this entire block of code, which you will now add to your website.
11. Login to your Site Builder and drop an html widget onto the page where you want the search box to appear; now paste the code here and click OK.

You should now see your Custom search Engine. You will need to Save and Preview Page to see it work.

**It is important to note** that Google's Custom Search Engine will not work if your site has not been indexed by Google so make sure you have submitted your sitemap to Google before you install this on your website. Here is a link to our tutorial which will step you through verifying your site with Google Webmaster and submitting a sitemap. After you submit your sitemap to Google it can still take time for your site to be indexed. [Google Webmaster Tutorial](http://www.yola.com/tutorials/google-....

Regards,

Jeremy
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
Pico search link: http://www.picosearch.com/
Photo of shockwave13

shockwave13

  • 3 Posts
  • 0 Reply Likes
The easiest way to add a search engine to your site is to use this code. Just plop it in your website.

This will search the whole internet (in another window)

[CODE]



[/CODE]

If you need code to search your whole website, or you want it to open the search results in the same window, as your search bar, I would need more information to build the code. Its pretty easy. Just email me at: [email]shockwave13@gmail.com[/email] and I will help you build the code.

Cheers
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
Hi shockwave13

Can you wrap your code in <!-- and -->

Like this:

<!--

YOUR CODE HERE

-->

That will keep the code form rendering.

Nathan
Photo of shockwave13

shockwave13

  • 3 Posts
  • 0 Reply Likes
Thanks Nathan! :) Here is the code... :)

<!--

<form action="http://www.google.com/cse" id="cse-search-box">
<div>
<input type="hidden" name="cx" value="partner-pub-0931223074117014:1533203349" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" size="55" />
<input type="submit" name="sa" value="Search" />
</div>
</form>

Its pretty easy to set up. Hope that helps. If anyone needs any custom code, just email me and I can create it for you.

Cheers
-->
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
No problem, thanks for this code!
Photo of shockwave13

shockwave13

  • 3 Posts
  • 0 Reply Likes
Remember if you email me (shockwave13@gmail.com) - I can customize it in this in any way...

- We can make it search only your website or give you the option to search google as well, so it will search both.
- Change the colors to fit your website theme
- We can make it so it displays on the same page, you put the search box on.
- We can change the length of the box

Its fairly easy to do.

You will need to email me these details.

- if you want it to search your own site, google or both
- if you want the results to open in its own window, or display on a certain page on your website
- if you want the search results to display on a certain page, I will need the full URL of that page
- and any colors or theme you want for the links, text etc

Hope this helps you guys. I know it took me a bit to figure out. Its pretty easy once you figure it out though.