Getting Google to search specific sites only

heebiejeebieclu's picture

They have: 527 posts

Joined: Aug 2004

Is there any way of Getting Google to search specific sites only?

Like if you wanted to start up an education site, and you wanted to put on a google search box that people could search for ' reactivity series ' and it would search Wikipedia, BBC bitesize, Google scholar, Doc browns science etc...

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

the searches would be like this:
site:wikipedia.org query

if I am not mistaken, you could do something with javascript to input that before the query string as it was sent to google.

heebiejeebieclu's picture

They have: 527 posts

Joined: Aug 2004

and it could do multiple sites?

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

Do you mean at once, or switchable between different ones?
because "site:anything.com query" works.... but if you mean something like Dogpile thats a different can of worms.

heebiejeebieclu's picture

They have: 527 posts

Joined: Aug 2004

no, not search engines, just sites. Say, you searched templates, and i want the results from specific sites only, say webmaster forums, webmasterforums101, freetemplates.com
and it would display googles results from those sites

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

yeah, you'd send google "site:webmaster-forums.net templates" it would give you the results for webmaster-forums.net about templates

example
http://www.google.com/search?q=site:www.webmaster-forums.net%20templates

You can get a little more advanced I suppose, and send multiple queries and harvest the results, if you wanted results from multiple specified sites.

In terms of just sending the queries, you could do it with some simple javascript.

<script language="javascript">
function searchsite()
{
go = "http://www.google.com/search?q=site:"+theform.sitename.value+" "+theform.query.value;
window.location = go;
}
</script>

<form name="theform">
<select name="sitename">
  <option value="www.webmaster-forums.net">Webmaster Forums</option>
  <option value="www.devshed.com">Devshed</option>
  </select>
<input type="text" size="30" name="query">
</form>
<a href="javascript:searchsite();">Go</a>
'

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.