Advanced Search Operators
(Feb 8, 2024)
Daniel M. Russell
Shortcut: bit.ly/AllTheOperators
Here, in one place, are all of the currently documented advanced search operators. Note that some operators come in two versions of the same operator: (e.g., allinanchor along with inanchor: ). Iâve written about them together rather than having two entries for the same kind of operator. (But, in truth, I almost never use the âallinâŚâ form.)
Note: In this document, I follow the square brackets convention, here a query is surrounded by square brackets. So, when doing the query, you wouldnât actually use the square brackets in your query. (Although it wonât hurt anything either...) Example:
[ codfish site:nytimes.com ]
_______________________________________________________________________
allinanchor: / inanchor:
-- Google restricts results to pages containing all query terms in the anchor text on links to the page. For instance: [ allinanchor: best restaurant Sunnyvale ] will return only pages in which the anchor text on links to the pages contain the words âbestâ ârestaurantâ and âSunnyvaleâ â that is, all of the words following the allinanchor operator. So, when using allinanchor: in your query, do not include any other search operators. By contrast, using the operator inanchor: only searches for the term thatâs next. (This is true for all of the âallâŚâ operators.) Example: [ inanchor:sales offer 2011 ] will search only for âsalesâ in the anchor text.
Definition: Anchor text is the text you see on a page that is linked to another web page
or a different place on the current page. For instance, this sample link has âsample linkâ as its anchor text. When you click on anchor text, you will be taken to the page or place on the page to which it is linked.
Example: [ allinanchor: best restaurant La Jolla ocean view ] - search for those terms in the anchor
allintext: / intext:
-- restricts results to those containing all the query terms you specify in the text of the page. For example, [ allintext: camping tent stove] will return only pages in which the words âcampingâ âtentâ and âstoveâ appear in the text of the page. Using the operator âintext: will search only for the next term in the text of the page. . (Note: using intext: in front of every word in your query is the same as using allintext: at the front of your query, e.g., [ intext:Victorian intext:artists ] is the same as [ allintext: Victorian artists ].)
Example: [ allintext:mesothelioma asbestos symptoms ] - search for all those terms on the page
allintitle: / intitle:
-- results to those containing all the query terms you specify in the title. For example,
[ allintitle: university relations ] will return only documents that contain the words âuniversityâ and ârelationsâ in the title of the page. Using the operator intitle: will search only for the next term in the title of the page. For instance, [ flu shot intitle:help ] will return documents that mention the word âhelpâ in their titles, and mention the words âfluâ and âshotâ anywhere in the document (title or not).
allinurl: / inurl:
-- restricts results to those containing all the query terms you specify in the URL. For example, [ allinurl:google faq ] will return only documents that contain the words âgoogleâ and âfaqâ in the URL, such as âwww.google.com/help/faq.htmlâ.
term1 AROUND n term2
-- limits results to those documents where term1 appears within a certain number of words of term2. For instance,
[ search AROUND 3 engine ]
will find only documents that have the words âsearchâ within 3 words of âengineâ â this is particularly useful when searching for common words that are relevant to your search only when in close proximity. (For instance, useful for finding two names in close quarters: [ âPolitician Surnameâ AROUND 5 âMajor Donorâ ] ) Note that this doesnât preserve order: it will find âengine searchâ and âsearch engineâ
before:
-- lets you find results that were published before a given date. Example:
[ avengers endgame before:2018-1-1 ]
where the date is YYYY-MM-DD - note that if you only specify the year, it will default to the first of that year. And likewiseâŚ
after:
-- lets you find results that were published after a given date. Example:
[ avengers endgame after:2020-1-1 ]
where the date is YYYY-MM-DD - note that if you only specify the year, it will default to the first of that year.
define
-- gives definitions from pages on the web for the term that follows. Useful for finding definitions of words, phrases, and acronyms. For example, [ define peruse ] will give a definition of the word âperuse.â This also works for many phrases, (Note: This operator used to be âdefine:â -- we got rid of the colon a while ago.)
[ define Hobsonâs choice ]
Of course, if you just search for a rare word (for example, [ surfeit ]) youâll get the definition as the first search result.
filetype:suffix
-- limits results to pages whose names end in suffix. The suffix is anything following the last period in the file name of the web page and can be many characters in length.
Example: [ search engine guidelines filetype:pdf ] will return Adobe Acrobat pdf files that match the terms âsearch,â âengine,â âguidelines,â and are pages whose names end with pdf. Note that the filetype: operator works with any string after the last period, thus this works: [filetype:1234567] Not useful too often, unless you know the final string of a document.
[ filetype:pptx superconductor lesson plan ]
Interesting note: You canât find MP3 files this way any longer. It used to work, but then copyright issues started raising their heads. The closest you can get to this now is to search the URL like this: [ inurl:mp3 ]
Update (July, 2023): Google has also deindexed CSV files, so [filetype:CSV] doesnât work any more. On the other hand, if youâre looking for data, consider looking at Google Data Set Search, which specializes in exactly that kind of search.
Fill in the blanks (* - the âstar operatorâ)
-- the *, or wildcard, is a little-known feature that can be quite useful. If you include * within a query, it tells Google to try to treat the star as a placeholder for any unknown term(s) and then find the best matches, up to 5 terms in length. For
Example: [ Google * ] will give you results about many of Google's products (go to next page and next page -- we have many products). The query [ Obama voted * on the * bill ] will give you stories about different votes on different bills. Note that the * operator works only on whole words, not parts of words. (See one of the Search Idioms below for an advanced use of * in a quoted query, such as [ âGoogle * productsâ ] .)
inanchor: (see allinanchor: above )
intext: (see allintext: above)
intitle: ( see allintitle: above)
inurl: (see allinurl: above)
Minus sign ( â ) to exclude
-- placing a minus sign immediately before a word indicates that you do not want pages that contain this word to appear in your results. The minus sign should appear immediately before the word and should be preceded with a space. For example, in the query [ anti-virus software ], the minus sign is used as a hyphen and will not be interpreted as an exclusion symbol; whereas the query: [ anti-virus âsoftware ] will search for the words 'anti-virus' but exclude references to software. You can exclude as many words as you want by using the â sign in front of all of them, for example [ jaguar âcars âfootball âos ]. The â sign can be used to exclude more than just words. For example, place a minus sign before the 'site:' operator (without a space) to exclude a specific site from your search results.
Number range ( .. )
-- The number range operator searches for results containing numbers in a given range. Just add two numbers, separated by two periods, with no spaces, into the search box along with your search terms. Example: [ Willie Mays 1950..1960 ] You can also specify a unit of measurement or some other indicator of what the number range represents. For example, here's how you'd search for a DVD player that costs between $50 and $100:
[ DVD player $50..$100 ]
OR
-- the Boolean operator OR specifies alternatives to use as synonyms in search. For instance, the query:
[ mesothelioma OR âlung diseaseâ treatment ]
could be used to search for a treatment for either mesothelioma or the quoted phrase âlung diseaseâ (Be sure to make the OR all uppercase. Lowercase or doesnât work.) Note that OR works inside of a quoted phrase. That is, a query like [ âjackfruit OR papayaâ ] is not a phrase search⌠itâs the same as [ jackfruit OR papaya ]
Phrase search (using double quotes, ââŚâ )
-- by putting double quotes around a set of words, you are telling Google to consider the exact words in that exact order without any change. Google already uses the order and the fact that the words are together as a very strong signal and will stray from it only for a good reason, so quotes are usually unnecessary. By insisting on phrase search you might be missing good results accidentally. For example, a search for [ "Alexander Bell" ] (with quotes) will miss any pages that refer to Alexander G. Bell.
Try this to see how it works:
[ âAlexander * Bellâ ]
-- this will give you results like âAlexander Graham Bellâ and âAlexander G. Bellâ and
âAlexander le Bellâ
Search exactly as is (double quotes around a single word) - aka âphrase searchâ
-- Google employs synonyms automatically, so that it finds pages that mention, for ex