DEV Community

Cover image for Custom web search with Alfred on your Mac
Lukas Polak
Lukas Polak

Posted on • Updated on • Originally published at lukaspolak.com

Custom web search with Alfred on your Mac

Custom web search with Alfred on your Mac

You can create a custom web search with Alfred (Spotlight on steroid) without a Powerpack upgrade.

  • Show Alfred preferences - press ⌘ + Space (or your custom shortcut) and type Alfred Searching for Alfred preferences
  • Go to the Features tab and select Web Search from the side menu Alfred Web Search list
  • Click on Add Custom Search button on the bottom right corner
  • Fill the desired data and click on Save button
  Search URL: https://developer.mozilla.org/en-US/search?q={query}
  Title: Search MDN for ‘{query}’
  Keyword: mdn
Enter fullscreen mode Exit fullscreen mode

You can also drop a custom icon if you want. Mine is from this link

Add Custom Search for Alfred

  • Open Alfred app Press ⌘ + Space and type e.g. mdn ternary operator Working example (mdn)
  • The result will be like this The result from the search query

Custom Searches (from Alfred documentation)

Custom searches allow you to set up search queries for sites you use regularly but are not included in Alfred’s default searches.

Find out the search URL on the site of your choice, then replace the query with {query} in curly brackets. Use the test search to ensure your search works as expected then click “Save” to add your new query.

Custom Search fields (from Alfred documentation)

Search URL: This is where Alfred goes when you use the keyword that you have assigned to this custom search. {query} is what you want to search for in that specific application or website.

Title: What is displayed in the results when you use your keyword.

Keyword: The keyboard shortcut that you want to use to call up this custom search.

Encode query using UTF8: This option helps if you’re using non-standard characters. Try ticking it if your query didn’t work the first time.

To hide a custom search you no longer need, either uncheck the “Enabled” box or select the custom search row and press backspace to delete it.

For more details, take a look at our tutorial on creating your own custom searches.

Top comments (0)