The BEST way to set custom search engines in desktop Firefox

This lesser known method is dead simple AND it does not use any extensions.

Personally, Firefox is my favorite web browser for both mobile and desktop. Despite a few shortcomings, Firefox can relatively easily become one of the most secure and private options available. And though the “out-of-the-box” experience leaves much to be desired, here's the best way to change one of the most important defaults relatively pain free: the search engine.

Now, I can hear you all saying, “Duh. I already know how to do that.” And though that may be true, I bet you might not know how to do it the way I am about to highlight. I also bet you will likely be glad I shared it with you if you didn't, even if you don't use it. And I bet again that there are a few of you whom this method will solve an existing problem, like it did for me. So if you are a betting person like myself, read on.

Disclaimer: The following steps are for the desktop Firefox application, regardless of what platform you are on. Funnily enough, the mobile apps are actually a bit easier to add custom search engines to, so you don't need to worry about this anyway.

How to change your Firefox search engine string

Ok, before I waste any more of your time, I will start with the steps to accomplish this. Then I will explain why you might want to do it this way later. After that, I'll highlight a few alternative—likely better known—methods to achieve a similar outcome.

Here's how to do it:

  1. In Firefox, navigate to about:config in the address bar and press Enter. Accept the “here be dragons”-esq warning, and go on.
  2. Type browser.urlbar.update2.engineAliasRefresh in the search field.
  3. There shouldn't be an existing config saved, so click the plus sign to the far right and leave “Boolean” selected.
  4. Make sure the value is set to “true”, and feel free to exit the about:config page.
  5. Open the Firefox Settings page.
  6. Navigate to Search, and scroll down just below the Search Shortcuts section.
  7. Here, you will find a shiny new “Add” button. Click it, and fill out the information, including the name of your search engine, the URL followed by the search term placeholder “%s” (ie. https://startpage.com/search?q=%s), and a keyword if you want to use one.
  8. Click Add Engine, and now you can select your new custom search engine just above in the Default Search Engine drop down menu.

Why would you want to do this?

The big question here, is “why would anyone want to do this?” Typically, adding a new search engine to Firefox is as easy as navigating to any search engine website, right-clicking in the address bar, and clicking add “insert search engine name here.” But, in some niche use cases, this won't work for everyone.

First of which is that sometimes Firefox doesn't detect you are on a search engine's landing page. That means the browser won't provide the option to add it. I've come across this issue when trying to use smaller, lesser known search engines in the past. The steps above provide an easy way to mitigate this.

Another example here is if you want to use multiple variations of the same search engine. If you've added a search engine, you often can't add another instance of the same engine.

This can be especially prevalent when using self-hostable metasearch engines like SearX and SearXNG. If you don't host your own instance, you might want some redundancy. I've often found that various public SearX instances will underperform compared to larger, managed offerings like Ecosia, Startpage, or DuckDuckGo. Having multiple instances setup and configured is one way you can mitigate this.

A third example is if you set up Firefox to clear your cookies when closed. Maybe you configured one or more of your SearX instances exactly how you like. Closing Firefox resets these tweaks, calling for the user to reconfigure these each time they reopen Firefox. That is, unless you make an exception in your settings to keep these cookies.

Like a few of their competitors, SearX and SearXNG offer a custom search URL that will apply your currently configured settings whenever you make a query using that search string. This comes with its own fingerprinting concerns, but given your threat model, that's possibly not an issue.

If that's you, and maintaining your cookie-free settings this way sounds appealing, you can follow the steps listed above but with that saved preferences search URL, and you'll be good to go.

There are many other reasons why you might want to do this, but these are the most prevalent I've come across. But, no matter what the problem may be, this method may provide the solution you are looking for.

Alternative ways to change Firefox search engine

There are a few other ways to add search engines in Firefox. As mentioned above, you can always try the intended right-click in the address bar, and that will work just fine for most people.

Alternatively, some providers offer their own extensions that change the search engine while typically bundling other privacy and/or security benefits. This may be easier than the steps above, but if you are like me, and you try to minimize your extension usage, then this isn't ideal.

This is especially true if you already have a tweaked browser and use existing extensions like Privacy Badger or uBlock Origin. Adding another privacy extension is redundant in that case, and it opens up your attack surface for little-to-no benefit.

A third option is using third-party extensions that allow users to add any search engine they desire. I won't mention any specifics because I don't particularly recommend them, given that you can achieve this exact same outcome without installing any extensions.

It may look easier on the surface, but the steps I've listed above are not difficult, and once you've followed them, you can add as many search engines as you'd like.

Closing thoughts

Though I do stand by the idea that this is the “best” way to change your search engine in Firefox, I admittedly don't utilize it right now.

Recently, I began hosting my own instance of SearXNG, and I've not had any reliability issues thus far. But, before this, I was using several different SearXNG and SearX public instances, all with varying reliability.

I also make an exception to keep cookies for my SearXNG instance in my Firefox settings, so I don't have to retweak my search engine every time I reopen the browser. This was the easiest option according to my threat model, and I've been happy with it thus far.

Before that, following these steps really helped me get away from using unnecessary extensions. It gave me all the power I desired when managing search engines in Firefox, and it will be something I keep in mind moving forward if there is any change in my work flow.

That being said, I bet many other Firefox power users and privacy advocates out there likely didn't know how to do this, and I hope someone finds this method as useful as I do.

Tags: #Tutorials Comments: Discuss...