How-To Geek
How to Search Just the Site You’re Viewing Using Google Search
Have you ever wanted to search the site you’re viewing, but the built-in search box is either hard to find, or doesn’t work very well? Here’s how to add a special keyword bookmark that searches the site you’re viewing using Google’s site: search operator.
This technique should work in either Google Chrome or Firefox—in Firefox you’ll want to create a regular bookmark and add the script into the keyword field, and for Google Chrome just follow the steps we’ve provided below.
Creating a Site Specific Search in Chrome
Right-click anywhere on the Chrome location bar and choose “Edit Search Engines”, and then click the Add button.


Now give the search engine a name and a unique keyword—you’ll want to make sure that it’s totally unique and unlikely to be used anywhere else in a URL, which makes it easier to use. I’m using “gs” as the keyword.


Now the important part—put the following into the URL box.
javascript:location.href='http://www.google.com/search?q=site:'+window.location.hostname+'%20%s';
Now once you saved the search engine, you can use the Ctrl + L shortcut key to highlight the location bar text, and type “gs” into the bar. You’ll notice the text on the right-hand side tells you to “Press Tab to search gs”. So press Tab.


Now just type in whatever you’d like to search the site for…


And there you are, a site: search using Google for the site that you’re currently viewing.


The great thing about this is that it works for any site—here’s an example of searching Lifehacker.


Thanks to the Lifehacker commenter Revolutions for the original idea, which we very slightly modified.
Got Feedback? Join the discussion at discuss.howtogeek.com
Comments (29)
Programmer by day, geek by night, The Geek, also known as Lowell Heddings, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on Google+ if you'd like.
- Published 12/27/10




Using Google Chrome I simply type the word or phrase I am looking for at the end of the url. I regularly do this to search HTG. Easies.
Great tip, thanks.
However, you don’t actually need to press tab to activate that search function. Just leave a space after the “gs” and chrome will do it automatically.
How do you do it in firefox?
This is going to save me much time! Thanks a bunch.
Dang, I right-clicked on everything I could find. The “Chrome Location Bar”? I never got “Edit Search Engines”. Am I dumb or won’t it work in XP? But I am using Google Chrome. What am I doing wrong?
@Sharan: http://www.pcmech.com/article/how-to-make-a-quick-weather-checker-firefox/
This is how, ignore the weather stuff.
Credits go to Asian Angel for providing me that link.
Chrome includes a simpler method within the browser itself.
1. Click on the wrench icon on the screen’s far right, just under the tabs
2. Click “Find.”
3. Enter your search words into the drop-down rectangle that appears. Click the icon at the end.
Works just like “Find” in Microsoft Office, and clicking on “Cache” UNDER a Google search rather than clicking on the hit link itself.
thanks Roberto Roberts: that is much easier than trying to get that “new engine” to work.
This does not quite work in FF. When you highlight the address bar and type GS (or whatever your keyword is) it does not give you an opportunity to enter a search term. It just does a “site:” search, eg. site:www.sevenforums.com. It returns everything on the site.
Thanks! This works also on my Opera 11! (Same Way as Chrome)
:)
The solution proposed by Roberto Roberts only works on the page being viewed. (same as ctrl-F).
This solution looks at the site. Hopefully it can give hits on pages in the website that don’t have links to that particular web page.
Thanks for the tip. It is very useful.
I just used Google’s advanced button, where you paste the URL, and it ALSO gives you the extra Search criteria (the Advanced page does)
But an interesting footnote:
I did a site search on a programming web site (Planet Source Code), using the Google Sire search.
It got three hits.
However the Planet Source Code web page, also had a search box to search the site’s contents.
It returned 33 hits.
That should give us all something to think about
Thanks for linking to my comment, and glad I could help :).
Also, I’m going to use your edit now. I was having some problems with quotations and symbols with the javascript code I was using. Thanks!
[And yes, I know I misspelled my username earlier.]
Is it only in google chrome or any other brower
Great tip!! Thanks!!!
without any specific browsers, one can use an alternative search engine, duckduckgo.com to do a search from the address bar. for example, if i want to search lifehacker site i do, from the address bar, a:
!lh Chrome
or
!lifehacker Chrome
and viola! search results within lifehacker site.
In the Google search bar, just type
site:howtogeek.com office (replace “howtogeek.com” with the site you want to search and replace “office” with your search string)
You can add another bookmark for the “define” command to look up words. For example:
define: geek (replace “geek” with the word you want to look up).
Sam, that only searches the page, not the website.
Wonderful, time saving tip. Thank You
Ctrl + F opens the find tool that searches the page. I don’t know if that helps.
this works on opera too..
Please explain how to do this in firefox…
@pitman your suggestion does not allow you to go to the location bar and type: gs whatever and get a google site: search for the current site.
@Eric In Firefox, right-click on the search box of any webpage and select ‘Add a Keyword for this Search’ (noticed this works with most form fields). In the ‘Name’ field put ‘gs’ and save. Go to where you’ve saved it (Bookmarks menu or toolbar), right-click it and select ‘Properties’. Paste the script in the ‘Location’ field, put ‘gs’ in the ‘Keyword’ field and save.
svchost.exe: how to geek
works the same ;)
Thank you very much for this technique. It seems to be the best solution currently for the lack of a “Search Site” button in Chrome.
has it stopped working? i’m using iron 11.0.700