Using Regex in GSC to Find Longtail Keywords and Questions


4 minutes well-spent

Before we begin, here’s the regular expression for finding questions that begin with “who, what, where, when, why, how, was, did, do, is, are, aren’t, won’t, does, if.”

^(who|what|where|when|why|how)[” “]

For a more complete list of question-based modifiers, see the end of this post.

Want to find these questions directly in WordPress?

Gscore is the WordPress plugin by Steve Toth that connects to GSC and helps you pull in keyword data such as the questions and longtails found is this post. Look out for Gscore on Black Friday 2021, starting at $99.

and anyone who purchases Gscore will also get copy of the entire SEO Notebook archive!

Back to the note!

With this info you the find questions with high impressions and beef up your answers.

Today’s note is super simple and is based on a recent announcement by Google. As of last week (early April 2021) Google now recognizes regular expressions (regex) for querying search console.

This works for queries and pages. All you need to do is:

  • Open search console
  • Click “performance”
  • Click “new” and then “query”
  • select “Custom (regex)”

There is a bunch of stuff you can do with REGEX, but I’m just going to focus on one specific strategy I created.

We’re going to use the regular expression: 

([^” “]*\s){7,}?

Type this into “query” “Custom (regex)” and it will show you all the keyword with 8 or more words in them. 

If you want keywords with 10 words or more change the 7 to a 9.

If you want to find keywords with 4 words or more, change the 7 to 3. 

If you change it to something like 20, you might find instances where people are cheating on tests. I found this in a few clients’ accounts.

So let’s go back to this:

([^” “]*\s){7,}?

Before you do anything, sort by impressions. Hopefully you got some results (if you didn’t, try reducing the number of words).

What kind of results do we get with this?

LONGTAIL queries.

Let’s stretch it out even further:

([^” “]*\s){15,}?

16 words or more?

NOTE: Keyword Volumes are by keywordseverywhere.com

My insight is this: use this this regular expression to find high impression longtail queries where you don’t have the snippet, then add that exact query as an H2 (quick and dirty). Then use a technique like this to write a featured snippet.

Boom. Done. See ya next week.

For more info on regex and to test your regex, I highly suggesting using https://regex101.com/

and thanks to Michael Martinez who added more question modifiers to my original regular expression:

^(who|what|where|when|why|how|was|wasn't|wasnt|did|didn't|didnt|do|is|isn't|isnt|are|aren't|arent|will|won't|wont|does|doesn't|doesnt|should|shouldn't|shouldnt|were|weren't|werent|would|wouldn't|wouldnt|can|can't|cant|could|couldn't|couldnt|if)[" "]

5 Responses to " Using Regex in GSC to Find Longtail Keywords and Questions "

  1. Love it! Thanks, Steve! Already adapted it to my German websites 🔥

  2. Sanjay says:

    Great tips!
    Does Keyword everywhere integration with GSC need paid subscription of Keyword everywhere?
    I tried the suggestion from https://keywordseverywhere.com/google-search-console.html but couldn’t locate “Search Traffic” -> “Search Analytics”.

  3. Ninil says:

    Great resource, thanks for sharing¡¡¡

  4. ^(who|what|where|when|why|how|was|did|do|is|are|aren’t|won’t|does|if|can|could|should|would|who|what|where|when|why|will|did|do|is|are|won’t|were|weren’t|shouldn’t|couldn’t|cannot|can’t|didn’t|did not|does|doesn’t|wouldn’t)[” “]

    Here is the final code with the Michael suggestion 🙂

    Copy the whole thing in GSC..slice and dice for more keyword ideas and topics.

Leave a Reply

Your email address will not be published. Required fields are marked *

Steve's SEO Toolbox

This is all stuff I genuinely love (affiliate links help you support SEO Notebook):

× Close