Regular expressions are a game-changer for SEOs who know how to use them. Recently, I have started using them more with the help of ChatGPT.
This article is a guide for non-technical SEOs to up their game with a combination of Regex templates and using AI.
The Fastest WordPress Hosting
How to Use This Guide
In some cases, you only need to copy & paste the regular expressions in Google’s Search Console:
In other cases, you need to make a list of the specific keywords you need. If you can’t change the regular expressions yourself, use ChatGPT and give it the instructions for the regex.
*ChatGPT’s free version of 3.5 is enough, no need to upgrade.
**You might need to specify a second time that the regex should work on GSC or try a couple of variations to work.
Brand Searches
This is my favourite regex to use. It can easily split your queries into branded and non-branded keywords.
This allows you to view the brand lifts of events or seasonal drops.
Let’s take an example of a big brand like Microsoft, the brand query would look something like this:
How to create a Brand Regex for GSC with ChatGPT
- Use your homepage as a filter.
- Export all the keywords from the GSC.
- Sort them by the search volume.
- Filter the branded keywords & misspellings.
- Feed them to ChatGPT.
I used 20 misspellings of Microsoft to do this, your regex will probably look different.
Branded vs Non-Branded
Remember to use “Matches regex” for the branded term.
Using “Doesn’t match regex” will give you the non-branded terms.
Short-Tail or Long-Tail Queries
Do you want to target long-tail queries and opportunities?
You can always use regex to filter your GSC keywords into long-tail and short-tail.
Use this regex for long-tail queries of 8 words or more:
Or, this one for short-tail queries of 1-4 words:
You can change the numbers to find longer or shorter queries!
Questions
Are you looking for ideas for articles?
Your GSC might have the answer … or the question, with question queries you might be ranking in the second and third pages.
There is an easy way to find all the question queries in your GSC, and that’s the following regular expression:
Just copy and paste it!
Longer questions
Short questions are usually more difficult to rank for. You can customise the regex to bring the long-tail questions only:
The above regex will bring questions of 8 words or more.
Find Keyword Groupings
Commercial Queries
If you want to export all the commercial queries from GSC or look at them as a group, you can use this regex:
This will group the queries that include:
- Best
- Top
- Alternate
- Alternative
- Vs
- Versus
- Review
You can change the words and replace any with another one, or add more by using | and then writing the word.
Or, you can feed ChatGPT your commercial queries and ask it to create a Regex for GSC that will match those and similar ones for you..
Product IDs or SKUs
Let’s say you want to view the performance of an ecommerce store, a specific series of products, or multiple products.
The products may be in multiple URLs and their IDs or SKUs look like these:
- A123
- A999
- A235
- PR097
- PR278
- ABC234
- ABC 987
- ABC091
I asked ChatGPT to write the regex to find these and similar product pages with different numbers.
This regex is to be used in the page filters.
Other Groups
You can do the same as above to group searches or pages that are related in any way you like. Here are a few ideas:
- Colours: Red, green, blue, yellow
- Clothing items: Shoes, t-shirts, pants
- Categories: Guides, How-tos, Templates
Misspellings
Misspellings are done similarly to Brand searches but for non-branded keywords.
Collect all the misspellings you can find in your search console or ask ChatGPT for possible misspellings of a specific word. Then, ask it to create a regex that can find all those misspellings.
Let’s Make Some SEO Magic
These are only a few of the possibilities where you can use regular expressions to filter queries through Google’s Search Console.
If you want to learn more about Regex for SEO, I suggest the following articles which helped with some ideas while writing the article, and are a good beginner’s guide on Regex:
- https://www.searchenginejournal.com/regex-seo-beginners-guide/432930/
- https://mrs.digital/blog/how-to-regex-search-console/
- https://supple.com.au/use-regex-search-console/
- https://erudite.agency/insights/beginner-guide-for-regular-expressions/
And, if you want to take your knowledge to the next level, I do suggest taking a look at LearnSEO.io. It also has a dedicated section on Regex!