Using Regex To Find Long-Tail Opportunities in Google Search Console

These are a couple of really easy ways to find long-tail queries that your site might be underserving and make use of the spreadsheet I shared last week.

Regex Examples for GSC:

([^” “]*\s){3,}?.*how.*

 

Steps to use Regex in GSC:

  1. Go to Google Search Console and select Search Results
  2. Change the date filter to the last 28 days
  3. Add a query filter
  4. Select Custom (regex)
  5. Select Matches regex
  6. Enter ([^” “]*\s){3,}?
  7. Export this to Google Sheets
  8. Create a filter in row E by selecting the row and going to Data → Create a filter
  9. Click the filter icon and choose Filter by condition → Is between → and select values of 10 and 20

filter position

Now you have all queries that are 4 words or longer and have an average position between 10-20. These are keywords you can look at targeting to move up to page one to boost traffic.

VARIATIONS

There are some variations you can do with this.

You can do this for just a specific page on a site.

For a very popular site with a lot of high rankings, you will need to do this on a per page basis. GSC has a limit of 1000 queries it will show at one time. When I use the site above, I have over 1000 queries in the top 5, so it won’t pull queries ranking on page 2.

To do this, simply add a page filter and select the URL you want to use.
You can also select a specific URL path. If you want to just look for terms under a specific category on your blog you would choose /blog/category/ for the page filter. **Another reason why it is a good idea to add categories to your URL structure.**

You could do this for generating new topic ideas.

Instead of sorting between positions 10 and 20, sor between 40-70 (or some other range you choose). These are terms that are related to your content but your current content is not serving well. You likely would want to create new pages for most of these terms instead of trying to move them up on current pages.

Use a different regex expression to sort by character count instead

If you wanted to sort by character count instead of word count, you could do that as well. Instead of the regex expression mentioned above, use ^[\w\W\s\S]{25,}. This will give you all queries over 25 characters. Again, you can adjust it by changing the 25 for longer or shorter queries.

Combine regex expressions

For example ([^” “]*\s){3,}?.*how.* will pull all queries that are 4 or more words and include ‘how’ in them.
This will not include just ‘note’ as a word on its own. It would also include terms like “how to”, “however”, etc.

Frequently Used RegEx Expressions

Without a doubt the SEO tool I use most frequently is Google Search Console.
It provides a wealth of data and opportunities for all but the newest of websites.
Although there is a ton of data in there, finding and sorting what you want is not always the easiest.
That’s where RegEx expressions come in. GSC supports Re2 syntax.

Instead, I’m just going to give you a spreadsheet with the most common RegEx expressions I use as well as a list of RegEx commands that make up these expressions so you can reverse engineer your own combinations.

Most Commonly used ReGex Expression Commands

RegEx Expression: Meaning:
.* Matches any query or page that contains the term surrounded by .*
^ Starts With
| OR
( ) Group elements together
$ Ends with
[ ] Matches range of characters
{#,##} Repetion of patterns from # to ## times (where # and ## are numbers). Example – {1,5} would be 1 to 5 times.
\w Matches ACSII letter, digit, or underscore
\W Matches anything that is not an ASCII letter, digit, or underscore
\s Matches whitespace
\S Matches anything that is not whitespace

Frequesntly used ReGex Expression in GSC

Regex expressions can be used for Query or Page filters in GSC

RegEx Expression: Filter by: Use Case: Notes:
.*term.* Query Find queries containing a specific term Will match all queries or pages including term
.*term1.*|.*term2.*|.*term3.* Query Find queries containing a range of terms Will match all queries or pages that include term1 OR term2 OR term3
^term1 Query Find all queries that start with a specific term Will match all queries starting with term
^term1|^term2 Query Find all queries that start with one of two terms Will match all queries that start with term1 OR term2
^[\w\W\s\S]{1,15} Query Find short-tail queries This will return queries between 1 and 15 characters
^[\w\W\s\S]{25,} Query Find long-tail queries This will return queries of 25 or more characters. You can adjust the 25.
([^” “]*\s){3,}? Query Find long-tail queries This will return queries of 4 or more words. You can adjust for longer or shorter terms.
^[\w\W\s\S]{80,} Page Identify excessively long URLs Will show you URLs that are over 80 characters long
.*/blog/.* Page Find all blog URLs (assuming the blog is under the /blog subdirectory) Could also be used to return URLs from any other directory
.*/blog/.* Query Find all queries the blog is getting traffic from (assuming the blog is under the /blog subdirectory) Could also be used to return Queries from any other directory
who|what|when|how|why|can|should|would|could|does Query Find queries that are questions This will pull queries that start with one of those words

Writing Regex with ChatGPT

writing RegEx

writing RegEx expressions 2

Related Posts

Special
Explore More