Advertisement
  1. Computer Skills
  2. Search Engine
Computers

How to Set Up Custom Searches in Safari

by
Difficulty:IntermediateLength:ShortLanguages:

If you’re using a Mac, Safari is by far the best browser. It looks great, is extremely energy efficient and even syncs everything across to any iDevices you own. It’s by far the best experience. 

Unfortunately, despite all Safari’s positives, it isn’t the most fully featured browser. Google Chrome might be an ugly resource hog but it has some powerful extra abilities such as custom search engines.

The good news is, just because Safari lacks custom search engines out of the box, it doesn’t mean you can’t add them in other ways. In this tutorial I’m going to look at doing just that.

Changing the Default Search Engine

With Safari you get a choice of four search engines: Google, Yahoo, Bing and DuckDuckGo. While most people are familiar with the first three, not everyone has heard of DuckDuckGo.

DuckDuckGo bills itself as almost an anti-Google. Rather than tracking your every move, they record no details about you. If you’re serious about privacy, DuckDuckGo may be the way to go. The one downside is that, although there results have improved a lot, I’ve found it to be less reliable than Google.

Safari defaults
The default search engines available in Safari.

If you can handle DuckDuckGo’s less accurate results, then there’s no need to install any extensions to get custom searches in Safari. Built into the search engine are !bangs

Typing ! and then a short code will search a specific site rather than using DuckDuckGo’s default engine. For example, !a MacBooks will search Amazon for MacBooks while !w MacBooks would search Wikipedia for MacBooks. For more information on !bangs, check out DuckDuckGo’s website.

To change the default search engine to DuckDuckGo, open Safari’s Preferences and select Search. From the Search Engine dropdown select DuckDuckGo ...or any of the other alternative search engines.

Safari’s Quick Website Search

If you don’t want to use DuckDuckGo and don’t need to have total control over custom searches, Safari’s Quick Website Search which Apple added to OS X with Yosemite may work for you.

If you search for something on a website and Safari detects the search, it gets added to Safari’s Quick Website Search list. 

To use it, enter the name of the website you want to search followed by the search term. For example, if you’ve previously searched for something on Amazon, type amazon MacBooks into the omnibar to be taken directly to Amazon’s search results for MacBooks.

quick website search
Safari's Quick Website Search in action.

Unfortunately, I’ve found Safari’s Quick Website Search to be incredibly finicky.

Sometimes it works but sometimes it just takes you to a Google page that searches for the website name plus your search term. You can get good results with it but it’s not as reliable as the other options. You also can’t adjust the keywords; to search Amazon you have to enter the full word rather than a shorter version.

Apple is constantly improving its software so there's a good chance that, within the next few updates, Safari’s built in custom searches will become a lot more powerful. Until then, Quick Website Search is an imperfect solution. 

For the perfect solution consider looking to extensions.

Setting Up Custom Searches With Omnikey

Omnikey is a free Safari Extension. It adds Google Chrome like keyword searches to Safari. You can configure it so that whatever shortcut you want triggers the custom search.

You can also control what section of the search URL is replaced so you can limit your searches to certain sections of individual sites.

To install Omnikey, download the extension from the developer’s GitHub page and double click on it. This will add it to Safari.

Once Omnikey is installed, you can configure the custom searches using the toolbar icon. Omnikey comes bundled with a number of common sites such as Amazon and Wikipedia.

If you use Omnikey’s bundled search engines, the developer adds their affiliate code to any searches. If you don’t want this, you can turn it off by heading to Safari’s Extensions panel in Preferences. Select Omnikey and uncheck the Support development… option.

omnikey preferences
Omnikey's Preferences.
  • To add a custom search to Omnikey, click on the toolbar icon. 
  • Next select Add Site
  • For the key enter the shortcut you want to use such as a for Amazon or w for Wikipedia. 
  • To find the relevant search URL, head to the site you want to add and search for a term such as test you want. This will give you the site’s search URL scheme.
omnikey extension
The Omnikey browser extension.

For example, searching Amazon.co.uk for test gives me http://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=test. By looking at that, I can see that the important section of the URL is the field-keywords=test. To modify it so Omnikey can use it, you need to replace your test word with {search} before you add it. Do that and add it to the URL field.

Thus, for Amazon, the final search URL is http://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords={search.

Getting More Advanced With Omnikey

The best thing about Omnikey is how much control you can gain over custom searches by selectively replacing the search variables. As an example, I read a lot of Kindle books. I’ve configured Omnikey so that k searches Amazon just for Kindle books. The URL to do it is https://www.amazon.com/s/ref=nb_sb_ss_c_0_6?url=search-alias%3Ddigital-text&field-keywords={search}.

You can use a similar trick to search within any site, or if a site doesn’t offer a very good search engine, use Google and site:[sitename.com] to limit the search just to it.

Conclusion

Safari is the best OS X browser available, however, it’s not the most fully featured. Once you start using custom searches it’s hard to go back to a browser without them.

Fortunately, with search engines like DuckDuckGo and Extensions like Omnikey you can add many of the features of other browsers, such as Google Chrome, into Safari.

It’s possible to get the best of both worlds: an energy efficient, pretty browser that plays nice with Apple products but also has all the best features of other browsers.

Advertisement
Advertisement
Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.