SEARCH

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.

image

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.

image

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.

image

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

image

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

image

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

image

Thanks to the Lifehacker commenter Revolutions for the original idea, which we very slightly modified.

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 12/27/10

Comments (29)

  1. Seasider

    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.

  2. Dave

    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.

  3. Sharan

    How do you do it in firefox?

  4. Rarf

    This is going to save me much time! Thanks a bunch.

  5. Rod

    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?

  6. pitman

    @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.

  7. Roberto Roberts

    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.

  8. peter

    thanks Roberto Roberts: that is much easier than trying to get that “new engine” to work.

  9. Gene

    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.

  10. DrSheldonCooper

    Thanks! This works also on my Opera 11! (Same Way as Chrome)
    :)

  11. Jake

    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.

  12. blackmacmac

    Thanks for the tip. It is very useful.

  13. RobCr

    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

  14. Revolutoins

    Thanks for linking to my comment, and glad I could help :).

  15. Revolutions

    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.]

  16. Tk

    Is it only in google chrome or any other brower

  17. mac

    Great tip!! Thanks!!!

  18. rino

    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.

  19. Sam Mackay

    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)

  20. Omar

    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).

  21. Seasider

    Sam, that only searches the page, not the website.

  22. Ron

    Wonderful, time saving tip. Thank You

  23. Krikor

    Ctrl + F opens the find tool that searches the page. I don’t know if that helps.

  24. operaUser

    this works on opera too..

  25. Eric

    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.

  26. whynnot

    @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.

  27. Emir

    svchost.exe: how to geek

    works the same ;)

  28. TeeJay

    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.

  29. a

    has it stopped working? i’m using iron 11.0.700

Enter Your Email Here to Get Access for Free:

Go check your email!