Creating a custom Firefox search that Googles all subdomains in a site

Firefox LogoHere’s a quickie Firefox hack – there may be quicker ways of doing this, but this is pretty nifty all the same.

Let me explain why I needed to search across all subdomains: on Unreality TV, we have a handful of subdomains, each containing its own installation of WordPress. Now, when I’m writing about a topic for the music blog, I might want to see what else we’ve written with regard to that person or band or celebrity.

Now, I could simply do a Google search and include “Unreality” as a keyword, which works fairly well. Lately though, I’ve taken to using an advanced search feature – the site: operator.

Typing “search query” site:* quickly retrieves posts from across the site that meet my query.

Adding the search to Firefox

So where does Firefox come in? Well, Firefox is my primary browser, and I use the search box extensively, I decided to see how easy it would be to add the domain search to the list of search engines. Here’s what I did:

  1. Browse to C:Program FilesMozilla Firefoxsearchplugins and copy the google.xml file.
  2. Go to the start menu and bring up the Run dialog. Type in %appdata%MozillaFirefoxProfilesdefault.somethingsearchplugins. The default.something folder will have a random string of 3 letters instead of the word ‘something’.
  3. Paste the google.xml file into this folder and rename it to something unique. The name of the site might be smart.
  4. Now, open the newly pasted file in your favourite text or web editor (I use Aptana). We need to make some changes.
  5. First things first: change the values for ShortName and Description in the file to suit your search. They’ll read Google and Google Search by default.
  6. Second, browse down to the line which reads <Param name=”q” value=”{searchTerms}”/>. After {searchTerms} add the following: “+site%3A*”. The modified line should read: <Param name=”q” value=”{searchTerms}+site%3A*“/>. If you didn’t replace the word with your actual domain name, then this isn’t going to work: go back and change that to the appropriate domain name.
  7. Save your changes, restart your browser, and you should have the new entry in your drop down menu (as seen below!).

FireFox custom domain search

Can you do it better?

Well, that’s how I accomplished the custom search in Firefox. As I said at the top, I’m sure there are many ways to do this. If you know of something more efficient, please drop me a line in the comments.

Update: I’ve included an unreality.xml file in a zip file below. Download this, extract it and put the file in %appdata%MozillaFirefoxProfilesdefault.somethingsearchplugins. Restart your browser and it should just work. Hack it to suit your own site!

5 thoughts on “Creating a custom Firefox search that Googles all subdomains in a site

  1. Steve

    Useful, but if there was a dynamic search that grabbed the domain of the page you were currently viewing that would be absolutely amazing.

    1. gerard

      Oooh, I really like that idea. It’s got to be do-able – grab the current domain, build a Google search string to run your query against

  2. Brauns

    When searching Google, Wikipedia and other searchable sites, I always use the Firefox Smart Keyword feature. E.g. when searching Google I write “g <search query>” ind the location/adress bar. To learn more about the Keyword feature check out this link: feature can easily meet the demand of searching subdomains.Firstly, go to and create a regular keyword for the google search. You can e.g. name it “Google Subdomain” and make the keyword “gs” or what ever you would like.Then in the browser’s top menu go to Bookmarks, right click on your created Google keyword and choose Properties.In the Location field the URL should be something similar to this (give or take a few unnecessary parameters): the “q=%s” part and add “+site%3A*” so the URL will read something similar to this:* the changes.Now you can simple type “gs <search query>” in the location bar with the wanted result.I find this way of searching much more easy, since you don’t have to use the Search Toolbar, and can simply jump to the Location bar to search by pressing F6 or open a new tap by pressing Ctrl + T in order to avoid having to use your mouse. And it is also a lot more easy to create than adding a new search to the toolbar, I believe. I did appriciate reading your article, though, since I didn’t know how to create a search to the toolbar.Btw, I’m Danish and using a Danish version of Firefox which may explain if I named some of the things wrong or didn’t use correct grammar etc. It also explains why my Google URL search string has the Danish top-level domain.This solution isn’t dynamic as you are requesting but very easy to use…

    1. gerard

      Brauns – that is a brilliant solution – much less messing around with files than my solution! I’m gonna try this out and see if I can make it work for me! Thanks!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s