Bookmarklet to search current site using Google

(This has been done before, but I’m putting my own spin on it.)

I often use Google to search a particular website, using “” and my search terms. It gets a bit tedious entering “”, so I made the following bookmarklet:

It prompts for the search terms, automatically adds the “site:” keyword and domain name, then goes to Google. You can select some text on the page before you click the bookmarklet, and your selected text will be used as the default search keywords.

For Firefox just drag-and-drop the link to your bookmarks toolbar. For IE, right-click the link then select “Add to Favorites…” (you might get a warning message since the bookmark contains javascript) then add it to your Links toolbar.

Inspired by: Search Bookmarklets

6 Responses to “Bookmarklet to search current site using Google”

  1. Bhagyesh Trivedi says:

    interesting thing. btw why does the word “love” come while posting comments?

  2. pat says:

    I was getting a lot of automated comment spam, so I hacked WordPress to do a simple word check. It doesn’t stop anyone from manually entering comments, but it stopped the automated spammers. Since it’s a custom hack on just one blog, it’s unlikely that the automated spammers will modify their procedures to get around it.

  3. May be your reader’s can benefit from more bookmarklets at this location.

  4. LouCypher says:

    This without adding ’’

    javascript:(function() { var h, q; h = location.hostname; q = (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); q = prompt('Search \'' + h + '\' using Google:', q); if(q != null) { if(h) { q = q; } location = '' + encodeURIComponent(q) + '&sitesearch=' + h + '&domains=' + h;}})();

  5. David says:

    Fantastic and it works with Opera browser too! Just drag it directly into your Opera’s toolbar.

  6. Daniel Bely says:

    Big thanks!
    Very useful bookmarklet

Leave a Reply