How to use Twitter search operators

Introduction

To find people, businesses, and events on Twitter, you can start with basic search or advanced search. But what if you'd like to search for more specific things fast without relying on Twitter's advanced search dialog? This is where knowledge about search operators is essential. A little effort goes a long way here and before long, you'll be able to spot opportunities in your business and industry like never before.

In this article, I will show you how to use Twitter search operators. These are useful if you want to build your own custom search queries quickly, without having to click here and there.

Keywords, Phrases, and Hashtags

This is where most searches start. Say, for example, you are looking for cats, simply type

cat

into Twitter's search field. This will return all tweets with the word "cat".

If you're interested in a specific phrase instead, put that phrase in quotation marks like this:

"cats are liquid"

This will return all tweets with this exact phrase in them.

If you're looking for tweets containing a specific hashtag, just write it down as, well, a hashtag. For example:

#CatsOfTwitter

will find you a lot of fluffy content.

Users and Mentions

To find tweets sent to a specific Twitter user, use the "to" operator like this:

to:nyannyancat

Looking for tweets sent from a specific user is done with the "from" operator:

from:nyannyancat

Note that you don't need the leading "@" when using "to" and "from".

If you want to find tweets mentioning a specific user, enter the Twitter handle. This time the "@" is necessary. For example, typing

@nyannyancat

finds all tweets containing this Twitter handle.

Excluding Things

Until now, I only covered content you want to see. But what about things you do not want to see in the results? That's where the "-" operator is necessary. Say you are searching for tweets without "kittens", modify the search as follows:

-kittens

The "-" operator can be applied to other terms as well. Read on to find out more.

Combining Multiple Options

This is where the real power in search lies: you can combine keywords, phrases, and users.

Per default, successive search fields are combined with "AND" logic. This means that tweets will match only if all conditions are met. For example, the query

cats -kittens

will only match tweets containing the term "cats" and not the term "kittens".

If you want to search for any keyword or phrase, put them in parentheses and combine them with the "OR" keyword. Take this example:

cats ("maine coon" OR ragdoll)

This will return all tweets about cats but is limited to either the Maine Coon or Ragdoll breeds.

You can also exclude sets of keywords or phrases. This could look like this:

cats -(persian OR "scottish fold")

That search returns all tweets about cats not explicitly mentioning Persian or Scottish Fold breeds.

Combinations also work with users. Say you'd like to follow the interaction between two accounts:

from:nyannyancat to:pusheen

Combining a user and a keyword like

to:pusheen cute

also works.

Additional Filter Options

There are even more options to further refine your search.

If you want to limit results to a certain language, use the "lang" operator. For example,

lang:en

will match only tweets in English. Have a look at this list of two-letter codes and test what works.

To filter for tweet engagement, you can add:

  • min_replies for tweets with at least the specified number of replies
  • min_faves for tweets with at least the specified number of likes
  • min_retweets for tweets with at least the specified number of retweets and quote tweets

For example, cats min_replies:20 min_faves:30 min_retweets:10 only returns tweets about cats with at least 20 replies, 30 likes, and 10 retweets.

As for the content and type of tweets, you can use:

  • filter:links to limit the results to tweets with links
  • filter:replies to limit the results to replies

For the opposite effect, you can use the "-" operator again, i.e. -filter:links will only show tweets without links and -filter:replies only tweets that are not replies.

Finally, if you want to limit the timeframe of your search, you have:

  • since to control the start of the search window
  • until to control the end of the search window

Both operators accept dates in the form "YYYY-MM-DD". Some examples:

  • since:2022-01-01 will only return tweets from January 1st, 2022, and later
  • until:2022-04-01 will only return tweets up to April 1st, 2022
  • since:2022-01-01 until:2022-04-01 will only return tweets between January 1st, 2022, and April 1st, 2022

And, of course, all of these filters can be combined with keywords, phrases, hashtags, and user search operators.

Conclusion

Twitter search operators are a quick and easy way to refine your searches on the platform. While they may seem a bit intimidating at first, they are actually quite simple to use.

If you want to save yourself time and frustration down the line, I urge you to give them a try. After you learn what they are and how they function, you will be able to construct some powerful queries that can help you find exactly what you are looking for on Twitter.

Back to blog