Skip to content

SearchEngines

Configure search engines in Firefox.

SearchEngines accepts an object with one or more of the following keys:

  • Add (array of objects): Add new search engines. Each entry accepts:
    • Name (required): the name of the search engine.
    • URLTemplate (required): the search URL with {searchTerms} to substitute for the search term.
    • Method: either GET or POST.
    • IconURL: a URL for the icon to use.
    • Alias: a keyword to use for the engine.
    • Description: a description of the search engine.
    • PostData: the POST data as name=value pairs separated by &.
    • SuggestURLTemplate: a search suggestions URL with {searchTerms} to substitute for the search term.
    • Encoding: the query charset for the engine. Defaults to UTF-8. Although there are five engines available in the ADMX template, there is no maximum number that can be specified — to add more in the ADMX template, duplicate the XML.
  • Default (string): set the default search engine by name.
  • PreventInstalls (boolean): prevent installing search engines from webpages.
  • Remove (array of strings): hide built-in search engines by name.
policies.json
{
"policies": {
"SearchEngines": {
"Default": "Example1",
"Add": [
{
"Name": "Example1",
"URLTemplate": "https://www.example.org/q={searchTerms}",
"Method": "GET",
"IconURL": "https://www.example.org/favicon.ico",
"Alias": "example",
"Description": "Description",
"SuggestURLTemplate": "https://www.example.org/suggestions/q={searchTerms}"
}
],
"PreventInstalls": true
}
}
}
policies.json
{
"policies": {
"SearchEngines": {
"Remove": [
"Example1"
],
"PreventInstalls": false
}
}
}
JSON schema
SearchEngines JSON schema
{
"type": "object",
"properties": {
"Add": {
"type": "array",
"items": {
"type": "object",
"required": [
"Name",
"URLTemplate"
],
"properties": {
"Name": {
"type": "string"
},
"IconURL": {
"type": "string",
"anyOf": [
{
"format": "moz-url"
},
{
"maxLength": 0
}
]
},
"Alias": {
"type": "string"
},
"Description": {
"type": "string"
},
"Encoding": {
"type": "string"
},
"Method": {
"type": "string",
"oneOf": [
{
"const": "GET",
"title": "GET"
},
{
"const": "POST",
"title": "POST"
}
]
},
"URLTemplate": {
"type": "string"
},
"PostData": {
"type": "string"
},
"SuggestURLTemplate": {
"type": "string"
}
}
}
},
"Default": {
"type": "string"
},
"DefaultPrivate": {
"type": "string"
},
"PreventInstalls": {
"type": "boolean"
},
"Remove": {
"type": "array",
"items": {
"type": "string"
}
}
}
}

Adding an internal search engine as the default

Section titled “Adding an internal search engine as the default”

This example adds a search engine for an intranet and makes it the default. Firefox replaces the {searchTerms} placeholder in URLTemplate with whatever the user searches for. With Alias, users can type intranet, followed by a space and their search terms, in the address bar to search with this engine, for example intranet holiday policy:

{
"policies": {
"SearchEngines": {
"Add": [
{
"Name": "Intranet",
"URLTemplate": "https://intranet.example.com/search?q={searchTerms}",
"IconURL": "https://intranet.example.com/favicon.ico",
"Alias": "intranet"
}
],
"Default": "Intranet"
}
}
}

Firefox sets this engine as the default when the policy is first applied and whenever the Default value changes. Users can choose a different default engine between these changes.

Software\Policies\Mozilla\Firefox\SearchEngines\Add\1\Name = "Example1"
Software\Policies\Mozilla\Firefox\SearchEngines\Add\1\URLTemplate = "https://www.example.org/q={searchTerms}"
Software\Policies\Mozilla\Firefox\SearchEngines\Add\1\Method = "GET" | "POST"
Software\Policies\Mozilla\Firefox\SearchEngines\Add\1\IconURL = "https://www.example.org/favicon.ico"
Software\Policies\Mozilla\Firefox\SearchEngines\Add\1\Alias = "example"
Software\Policies\Mozilla\Firefox\SearchEngines\Add\1\Description = "Example Description"
Software\Policies\Mozilla\Firefox\SearchEngines\Add\1\SuggestURLTemplate = "https://www.example.org/suggestions/q={searchTerms}"
Software\Policies\Mozilla\Firefox\SearchEngines\Add\1\PostData = "name=value&q={searchTerms}"
Software\Policies\Mozilla\Firefox\SearchEngines\Default = NAME_OF_SEARCH_ENGINE
Software\Policies\Mozilla\Firefox\SearchEngines\PreventInstalls = 0x1 | 0x0
Software\Policies\Mozilla\Firefox\SearchEngines\Remove\1 = NAME_OF_SEARCH_ENGINE
<dict>
<key>SearchEngines</key>
<dict>
<key>Add</key>
<array>
<dict>
<key>Name</key>
<string>Example1</string>
<key>URLTemplate</key>
<string>https://www.example.org/q={searchTerms}</string>
<key>Method</key>
<string>GET | POST</string>
<key>IconURL</key>
<string>https://www.example.org/favicon.ico</string>
<key>Alias</key>
<string>example</string>
<key>Description</key>
<string>Example Description</string>
<key>SuggestURLTemplate</key>
<string>https://www.example.org/suggestions/q={searchTerms}</string>
<key>PostData</key>
<string>name=value&q={searchTerms}</string>
</dict>
</array>
<key>Default</key>
<string>NAME_OF_SEARCH_ENGINE</string>
<key>PreventInstalls</key>
<true/> | <false/>
<key>Remove</key>
<array>
<string>NAME_OF_SEARCH_ENGINE</string>
</array>
</dict>
</dict>
FirefoxFirefox ESRFirefox Enterprise
SearchEnginesAvailable since 139Available since 60Available since 149
Add12Available since 139Available since 60Available since 149
RemoveAvailable since 139Available since 60.2Available since 149
  1. Encoding is available since Firefox ESR 91.
  2. Method listed POST, but POST (and PostData) supported added in Firefox ESR 68.

CCK2 Equivalent: searchplugins (Add), defaultSearchEngine (Default), disableSearchEngineInstall (PreventInstalls), removeDefaultSearchEngines (Remove)
OMA-URI: SearchEngines
Preferences Affected: N/A