Most search engines support a search operator, a text command you can include to search a specific site for keywords. It’s a great way to search a site without first manually visiting it, then tracking down its search tools, assuming it has any.
With TextExpander for Mac, Windows, and iOS, you can save even more time by turning these searches into a group of text snippets. These snippets allow you to avoid manually typing the operator and your intended site, and instead instantly trigger site searches every time you need them in any app, including browsers and productivity utilities like Alfred.
How search operators work
The search operator is pretty straightforward. After your search term, add “site:xyz.com” to make search engines like Google, DuckDuckGo, and others return results only from the pages of your chosen site instead of the entire internet.
TextExpander snippets can crank the convenience of site search up to 11. With just a couple letters or a quick keyboard shortcut, you can instantly add your site search command every time you need it, everywhere you need it.
The setup
Creating a site search snippet is about as straightforward as the operator itself:
- Note the sites you would like to search much more quickly, or would like to start searching
- In TextExpander, click the (+) sign to create a new snippet
- In the Content section, add site:xyz.com, replacing xyz.com with your chosen domain, of course, or a blank fill in area so you can copy/paste in any site when you use the snippet
- For the snippet abbreviation, be sure to pick a short, memorable shortcut so it’s easy to expand when you need it. See our example below
If you don’t already have a memorable snippet abbreviation system in place, may we suggest starting with /s_ _, where the trailing letters are short for the site’s name. For example:
abbreviation: **/slh**
snippet: site:Lifehacker.com
Now, to use your amazing new site search snippets, all you need to do in any browser on Mac and PC is:
- Type your query
- Add a space
- Trigger your snippet with your abbreviation, such as/slh
- Press Return to expand the snippet and quickly search a site
Alternatively, you can also use TextExpander Search. With a quick keyboard shortcut, you can find and expand your snippets without having to remember specific abbreviations.
On iPad and iPhone, your site search snippets will also work in any browser as long as you’re using the TextExpander Keyboard.
Advanced Practices
For Mac and PC users, TextExpander has a killer way for you to simplify or automate your site searches, depending on your actual needs. It’s called Fill-In Fields, and it’s a way to create a sort of choose-your-own-adventure snippet. It includes blank fields you can fill in on the fly, as well as pull-down menus to customize a snippet each time you expand it.
Fill-In Fields to Make Site Searches Easier
For example, let’s say you don’t search any particular site often enough to create a snippet. But you do want help adding the site search syntax when you do use it.
You could create a generic site search snippet that includes the basic site search command, then blank spaces to fill in your search keyword(s) and the site you want to search:
- Create a new snippet
- From the Fill-In menu in the snippet’s toolbar, select Single Line Field
- In the pop-up window that appears, name this field “Search Keywords,” but leave the Default Value box blank
- Click OK to insert your new Single Line Field at the start of your new snippet
- Press Space Bar once
- Add the “site:” search operator (don’t forget the colon!)
- Add another Single Line Field
- Name this one “Site Search,” leave the Default Value box blank
- Assign an abbreviation so it’s easy to use this snippet in a web search field. May we suggest /ss (short and easy to remember for “site search”)
Your snippet should end up looking like this. Yes, you can cheat and just copy and paste this:
%filltext:name=Search Keywords% site:%filltext:name=Site Search%
Now, when you use this snippet wherever you can search the web, TextExpander will display a temporary pop-up window (kinda like the internet, except this one’s actually good for you) where you’ll fill in the blanks. Once you’re ready, click OK or press Return, and your lightly customized snippet will expand right where you need it.
Bonus Tip
Use copy/paste to your advantage with a TextExpander trick called a clipboard macro, which you can add to this snippet to speed things up even further. As part of the snippet expansion, it will automatically paste whatever you most recently copied where you chose in your expanding snippet.
To pull this off, start with the instructions above. But in step 2, swap out the Site Search single line field with the Clipboard macro by going to the keyboard menu in the editing bar and choosing Clipboard. It allows you to copy the URL of the site you want to search then expand your snippet. The URL will be inserted in place of %clipboard as the site to search. This modified snippet should look like this (yes, you can cheat again):
%filltext:name=keywords% site:%clipboard
Have Your Choice of Site Searches with a Pop-Up Menu
One final idea to play with here is adding a pop-up menu to your site search snippet so you can point and click for the site you want to search.
Instead of creating individual snippets (and abbreviations) for each site, you could create one snippet with a pop-up menu of your commonly searched sites. Each time you use the snippet, you could type your keywords, pick a site to search, and TextExpander figures it all out to get you where you’re going.
To add a pop-up menu to your site search snippet, follow the steps above through #6. When it comes to step 7, instead of adding a second fill-in field:
- Pick the Fill-Ins > Pop-Up Menu option
- In the window that appears, add “Site Searches” for the field name
- In the “Options” text boxes, fill in the full URLs you want to search
- Use the (+) and (-) buttons to add and subtract field options
- Click OK when you’re done to insert the pop up menu
When you use this snippet, the aforementioned pop-up TextExpander window will have a convenient drop-down menu of your intended sites to search. Pick one, click OK, and off you go.
Go forth and search
With just a couple site search snippets added to your arsenal, you’ll start finding the results you need much faster, and remove some of the key friction from search in the first place.