Change the default search engine for Firefox's address bar

I love the ability to just type something into Firefox's address bar and do a Google search. But I was wondering if there was some way to customize what search engine Firefox used?


In FireFox, in your address bar type

about:config

and press Enter. Now look for an entry that's titled "keyword.URL", this is the config key that contains which search URL to use when you search through your address bar. If you double click the entry, you can change the value.

enter image description here

By default it should be set to google, which uses this query URL: http://www.google.com/search?&q= It's possible it's a bit different but it should be similar.

Some examples for search engines' query URLs:

Google: http://www.google.com/search?&q=
Yahoo: http://search.yahoo.com/search?p=
Ask: http://www.ask.com/web?q=
Bing: http://www.bing.com/search?q=1

If you want an other search engine, and don't know the query URL, do the following:

  1. Go to your preferred search engine (E.g. Google)

  2. Perform a search with an easily recognisable keyword like "HELLOWORLD"

  3. In your address bar, there should be an URL containing your keyword. For Google it would be something like http://www.google.nl/search?q=HELLOWORLD&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:nl:official&client=firefox-a

  4. Now just delete everything after the "=" that's just before your chosen keyword. Your query URL for Google would be: http://www.google.nl/search?q=

    enter image description here


Starting with version 34.0.5, this can be changed by going to Options Search

options
(source: mozilla.net)

It can also be changed programmatically, although this is more difficult. The search engine setting is now kept in the Profile Folder, in a file called search-metadata.json. Example

{
  "[global]": {
    "current": "Google",
    "hash": "fGiy1O53LgQtereW/4qUSlwFfagTNKGghURIbAFw8wY="
  }
}

The hash can be created by using this example Bash script

profile=default
provider=Google
disclaimer="By modifying this file, I agree that I am doing so only within \
Firefox itself, using official, user-driven search engine selection processes, \
and in a way which does not circumvent user consent. I acknowledge that any \
attempt to change this file from outside of Firefox is a malicious act, and \
will be responded to accordingly."
printf "$profile$provider$disclaimer" | openssl sha256 -binary | base64

This change was discussed at Bugzilla and can be found in the source code.


The option of Keyword.Url, as of FF23, has been removed.

The address bar (1) and the search bar (2) share the same settings. So, if the search bar is set to Yahoo, then so it will be when you search (see screen below)

enter image description here

To add a new provider to the list which affects both the 'awesome bar' (now called location bar I think) and the search bar, choose the engine from the search box drop down arrow (beside the Purple Y for Yahoo! (near to the number 2))

However, as it currently stands, it looks like the Keyword.Url parameter has been removed. There is nothing which replaces it (in the same area).

I found a plugin https://addons.mozilla.org/en-US/firefox/addon/keywordurl-hack/ (instruction on setting up

and

https://addons.mozilla.org/en-US/firefox/addon/keyword-search/

This is speculation but I believe this functionality was removed to prevent search hijacking.

There is also additional search options with the latest Firefox, if you right click in any (most/some) search boxes, even the one at the top of this SU page, you can "Add keyword to this site". This will then let you choose the search engine from the 'location bar' (pictured as 1) and add your search phrase by typing in the bookmark name you gave.

And here is the reasons fully behind the decision https://bugzilla.mozilla.org/show_bug.cgi?id=873734