Safari Keyword Search is an extension for Safari on Mac, iPhone and iPad that lets you search any site straight from the address bar. Type a keyword before your search and you go directly to that site’s results. For example, type w monkeys to search Wikipedia for monkeys, or y rick astley to search YouTube.
You can also use it to replace Safari’s search engine with any search you like.
Getting started
Install the app from the App Store.
Turn on the extension in Safari:
Mac: Safari Settings → Extensions, and check Keyword Search.
iPhone: tap the page menu button at the left of the address bar and choose Manage Extensions.
iPad: tap the puzzle piece-shaped button in the address bar (and choose Manage Extensions if a menu appears).
Allow the extension to access your search engine’s website when Safari asks (Always Allow on This Website while you are on it). Without this permission Keyword Search can’t see your searches, so the keywords won’t work. If you switch search engines now and then, choose Always Allow on Every Website instead. Keyword Search doesn’t need access to the sites it sends you to.
Try typing y rick astley in the address bar.
Default searches
These searches are included from the start:
am: Apple Maps
ao, wm: Archive.org Wayback Machine
az: Amazon
ddg: DuckDuckGo
def: Wiktionary
down: Down for everyone or just me
ebay: eBay
g: Google
gh: GitHub
gi: Google Images
gm, gmaps: Google Maps
imdb: IMDb
rd: Reddit
so: Stack Overflow
tr: Google Translate
w, wi: Wikipedia
wa: Wolfram Alpha
y, yt: YouTube
Your own searches
Open the extension’s settings from Safari: the Keyword Search button in the toolbar on Mac and iPad, or the page menu on iPhone. There you can edit, delete and add searches.
A search needs one or more keywords, separated by commas, and a URL with @@@ where the search terms should go, for example https://example.com/search?q=@@@.
Settings
Make default
Turn this on for one of your searches to use it whenever you search without a keyword, instead of Safari’s own search engine. This is a way to use a search engine Safari doesn’t offer as your primary search engine.
Safari’s search engine
Keyword Search works by recognizing the search that Safari makes, whichever search engine you use. If you pick the search engine set in Safari’s settings here, keywords only work for searches from the address bar, and not when you search on Google’s (or DuckDuckGo’s etc.) own website. The default, Any, works with all search engines. Baidu, Sogou and 360 Search are only recognized by their address, so for those the setting can’t tell the two apart.
Allowed keyword locations
Choose whether you can also type the keyword after your search, like monkeys w. This can be overridden for each search.
Advanced settings for each search
What spaces in your search are replaced with (+ by default, Wikipedia uses _), and whether the search terms are URL-encoded.
Export and import
Copy all your searches and settings to the clipboard, or paste them back in, for backups or moving between devices without iCloud.
Sync
Your searches and settings sync between your Mac, iPhone and iPad through your own iCloud account. Changes made on different devices are merged, so if you add searches on two devices, you keep both. Devices that still run an older version of the app keep syncing too.
Requires Safari 17 or later (iOS and iPadOS 17, or macOS 12 or later with Safari 17).
Did the extension disappear from Safari on the Mac?
There is a bug in Safari on macOS where extensions sometimes disappear. To fix it:
Safari doesn’t let extensions change how the address bar searches, so Keyword Search works like this:
It listens for Safari starting to load a page.
It checks whether the address belongs to one of the search engines Safari can use: Google, Bing, Yahoo (including regional Yahoo sites), DuckDuckGo, Ecosia, Baidu, Sogou or 360 Search. If you have picked Safari’s search engine in the settings, only that one counts, and only with the details Safari adds to searches from the address bar.
It reads the search terms from the address.
If the search starts with one of your keywords, it quickly sends the tab to that search instead.
Reading the search terms from the address is not ideal, but it’s the only way with the current extension APIs. These edge cases can happen:
Sometimes the search engine’s own results load in the tab before the extension kicks in, especially if the search you are redirected to is a bit slow to respond (Wikipedia, I’m looking at you).
If you use more than one keyword, like ddg g w monkey, the extension can in rare cases trigger more than once. There are workarounds for this, but it can still happen.
Safari also has a newer way for extensions to redirect pages before they load (declarativeNetRequest), which would avoid loading the search engine at all. I tried using it, but it currently seems to flaky and brittle to be usable.
The old Safari extension API had a beforeSearch event that made all of this a lot easier. To any Safari developers who might be reading this: hello!