Is there a way I can add a custom search URL to the Firefox search bar? e.g. I'd like to provide a URL such as , where Firefox replaces the %s with the content of the search box.
Both IE and Opera can do this, but I can't figure out how to set it up in Firefox.
215 Answers
Add keywords to the address bar:
For example, you can set up your browser to search for bread at stackoverflow.com by simply typing so bread into the omnibar.
Do this by right-clicking on the search bar on the website you commonly search. You can do this for the Search field on any website.
Specifically:
- Go to the site you want to use to search
- Right-Click on the search box you fill out on their page (not Firefox's)
- Select "Add a keyword"
- Enter the keyword to use when you want to search in that site (eg: "so")
I'd like to provide a URL such as where Firefox replaces the
%swith the content of the search box.
You can do this with Firefox! Add a bookmark with that URL, where %s is the search query, then simply set a keyword for the bookmark. You can then search using <key> <search term> in the address bar. For example, the bookmark with keyword g means you can type g stack overflow in the address bar to search Google for "stack overflow".
Alternatively, go to the site you want to search, right click in the search box and click "Add a keyword for this search".
10The actual, no-bookmark solution for this task:
Open a web page that has a search on it (e.g. SuperUser: superuser.com).
In the address bar, expand the address bar by clicking on it.
If the website supports searching, it will show up in the bottom area of the expanded address bar. Click the plus icon that is enclosed in a green circle. This adds the web page’s search to the search engines in your preferences.
If you want to set a keyword (e.g. su) for this search, follow these steps:
- Open the search preferences (or type the following URI in your address bar:
about:preferences#search) - In the table under the column for “Keyword”, double-click in order to set your own keyword.
The Add custom search engine extension lets you create a new search engine and customize it.
6Your best bet is to go to the Mycroft Project and search for an already made search engine plugin.
If you can't find one you can create your own on the submissions page. Full instructions are available.
2Ready2Search is also an available free service that helps you do this for any site. It makes search plug-in for Internet Explorer, Firefox, Chrome, and Google Toolbar with great customization options (icons, query parameters, etc.).
Alternative way for custom search
For an example Google Translate string: so top answer here doesn't work. So I found a workaround with the plugin: add-custom-search-engine
And here we go:
Goes to :
3New solution (since the previous one does not work anymore):
Now if you visit a website like Twitter, Firefox will let you add the Twitter search easily (). But in case you want to add another website that is not supported, you will need a web server like Apache.
Below would be the solution for Twitter in case they don't use the search engine file opensearch.xml anymore.
Create a file, for example twitter_search.htm (this HTML source code is used on twitter.com, I just removed the / before opensearch.xml):
<link rel="search" type="application/opensearchdescription+xml" href="opensearch.xml" title="Twitter">Then create another file, with the same name used in the href parameter of the previous HTML code, for example opensearch.xml with this content (this XML source code is used at ):
<OpenSearchDescription xmlns="" xmlns:moz="">
<ShortName>Twitter</ShortName>
<Description>Twitter Search</Description>
<Url type="text/html" method="get" template=""/>
<Image width="16" height="16">
<InputEncoding>UTF-8</InputEncoding>
<moz:SearchForm>
</OpenSearchDescription>If needed, customize these files to replace the search URL, search form URL, name, description and icon. Put these 2 files in a folder of your web server and open the HTML file that you can find by visiting in your web browser. You will be able to add your custom search engine to Firefox.
Previous solution (not working anymore):
Here is how I restored the Twitter search engine for Firefox, which seems to have been removed in Firefox 78 (you could create a search for other websites also based on this answer):
I tested with the Linux version of Firefox (Ubuntu package) but it should work with any operating system by creating the distribution folder / subfolders and search plugin file ().
In my profile folder .mozilla/firefox/, there was a file search-metadata.json that contained a link to a non-existing file /usr/lib/firefox/distribution/searchplugins/locale/en-US/twitter.xml.
So I created this file with the following content (based on the documentation and search plugins already present ):
<?xml version="1.0" encoding="utf-8"?>
<OpenSearchDescription xmlns=""> <ShortName>Twitter</ShortName> <Description>Twitter Search</Description> <InputEncoding>UTF-8</InputEncoding> <Image height="16" width="16">data:image/x-icon;base64,
AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAA
AAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A
////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD/
//8A////AP///wD///8A////AP///wD///8A////AP///wz///8f////H////x////8Y////B///
/wD///8A////AP///wD///8A////AP///wD///8A////A////yj7789g9tV+ofbVfqH21X6h+N+e
ifz03lf///8o////A////wD///8A////AP///wD///8A////APr37g/PsGCftogQ7r2JAP/bnwD/
7qwA/+6sAP/urAD/9Mtftv357z////8D////AP///wD///8A////AP///wD///8A////AP///w/5
7c5a88VQwu6sAP/urAD/7qwA/+6sAP/xvDDb/fnvP////wD///8A////AP///wD///8A////AP//
/wDz5L5X7bgv2+6sAP/urAD/7qwA/+6sAP/urAD/7qwA//G8MNv///8Y////AP///wD///8A////
AP///wD///8M9NN+n+6wD/PurAD/7qwA/+6sAP/urAD/7qwA/+6sAP/urAD/9Nyegf///wD///8A
////AP///wD///8A+O3PVu6wD/PurAD/7qwA/+6sAP/urAD/7qwA/+6sAP/urAD/7qwA//G8MNv/
//8A////AP///wD///8A////ANasQMXurAD/7qwA/+qpAP/YnAD/1JkA/+6sAP/urAD/7qwA/+6s
AP/urAD/////FP///wD///8A////AP///wDz255+7qwA/9icAP+6ixDuz7Bgn9m8b5TurAD/7qwA
/+6sAP/urAD/7qwA//jkr3j///8M////AP///wD///8A47Y/ysmRAP/PsGCf+vfuD////wDw584w
46QA/+6sAP/urAD/7qwA/9+hAP/orA/z9OrPQv///wD///8A////AMypT7Hhz55g////AP///wD/
//8A////AMOaL9DMlAD/0JYA/8mRAP/FoEC/vpIf4OPQnmL///8A////AP///wD69+4P////AP//
/wD///8A////AP///wD69+4P3ceOcNi/foHhz55g////APr37g/69+4P////AP///wD///8A////
AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A
////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD/
//8A//8AAP//AAD//wAA8P8AAMA/AAD4HwAA8A8AAOAHAADgBwAAwAcAAOAHAADHAwAA3wMAAP/f
AAD//wAA//8AAA==</Image> <Url type="text/html" method="get" template=""/>
</OpenSearchDescription>To get the Base64 of the latest Twitter icon that you can see above, I downloaded and used the Linux command base64 favicon.ico.
The following files were present in my profile folder but were not needed anymore so I removed them to avoid potential conflicts (you can backup files in case you want to reuse them): search-metadata.json, search.json, search.json.mozlz4.
The following answers did not work for me but contained useful information:
7You can also make complex searches with multiple parameters, and here’s how.
For instance, imagine you have a two field search like this fictitious example:
http://
You can make a new mm search like:
javascript:q="%s";if(q.indexOf(",")>0){q=q.split(",");location.href=""+q[0]+"&album="+q[1]}(in Firefox it would be a bookmark with keyword mm)
Then you can directly search for: mm david bowie,ziggy startdust (directly in the address bar)
I choose “,” as the separator, but it’s just an example. It’s perfectible, but you get the idea, and anything is possible.
※ Notice that some browsers (including Opera 12) may not execute your JavaScript in a new tab with no preloaded page.
For ESR, you can add (and set default) a new search engine using policies.json. E.g. use the following:
{ "policies": { "SearchEngines": { "Default": "DuckDuckGo", "Add": [ { "Name": "DuckDuckGo", "URLTemplate": "", "Method": "GET", "IconURL": "", "Alias": "Ducky", "Description": "Duck Duck Goose" } ] } }
}The location of the policies file is described e.g. in this post.
It's as simple as right clicking in a search field.
The other advantage is that this process creates a bookmark for you. If you use something like XMarks to synchronize your bookmarks, you can access the same search functionality across all synchronised computers.
2A bit late to the party, but for those finding this thread now you can click the search icon in the search bar when on the site you want if it has a green + icon on it.
1As of FF100, for the website searches that cannot be added with , a solution is to use the mozlz4-edit plugin.
FF stores all the search engines within a file search.json.mozlz4 that cannot be edited in a regular text editor.
With that plugin, one can directly (but guided) add search engines.
E.g. Adding "AllMusic" as search engine:
If you want a icon, you can dowload an icon from the website and add it too.
Rem: you have first to locate that search.json.mozlz4 file.
On Win10 it is in %appdata%\Mozilla\Firefox\Profiles\xx_profile_id_xx.default-release\
To mimic chrome's "site search" feature:
worked exactly as expected and super easy to config
1I believe he's referring to keyword.URL in Firefox's about:config page.
In Firefox's address bar type about:config, then search for keyword.URL and replace its contents with "", for example.