Regular expressions (regex) are a pattern-matching syntax that you can use to search for complex strings of characters. Google’s Search Console (GSC) provides the ability to filter and sort search queries and page performance data using regex.
You can optimize your website’s performance by analyzing search data using special regex filters.
The benefits of using Regex in Google Search Console
Regex allows you to read and analyze data without having to rely on the Google Analytics web application or other external tools. Here are the many ways you can use regex to optimize website performance:
- Build queries to filter pages with the lowest CTR and determine how to optimize them for better performance.
- Gain insights into the type of searches your pages are triggering, e.g. B. How-to questions, misspelled words, etc. Optimize your site to accommodate these searches.
- Based on query intent, companies can fill knowledge and information gaps about their products and services.
- Get as granular as you like with regex targeting specific products or pages. For example, understand the data and metrics of a limited edition offer within a certain duration.
- Instant results based on previous GSC data, no need to set up filters and wait for targets.
- Compare and contrast custom results for different datasets to gain further insight into your site’s search performance.
Free resources for learning regex
Regex is easy to learn as its syntax is fairly simple. You can use the following resources to get a good understanding of the syntax and its application in different programming languages:
- RegexOne: An interactive regex tutorial simplified for non-technical users.
- A GitHub repository, Learn Regex the Easy Way: Comprehensive regex text course with examples, tests, and translations available in various languages.
- Our own article The Beginner’s Guide to Regular Expressions With Python: Quick guide to regex syntax supported by Python.
- RegexLearn’s Regex for SEO: An interactive, open-source platform for learning Regex for SEO.
Follow the hashtag #performanceregex Twitter to learn about new regex ideas and queries for GSC.
How to use regex filters in Google Search Console
Here is a step-by-step guide to using regex filters in Google Search Console:
Step 1: Sign in to Google’s Search Console
You need administrative access to your site’s GSC account to use Regex after logging in.
Step 2: Click Performance on the left menu
Select the search property you want to view from the dropdown menu on the left. Then click perfomance to display search query data that you can manipulate with regex.
Step 3: In the filter options, click +New
Click on +New in the filter menu at the top of the page to bring this up inquiry and book page options.
Step 4: Click inquiry or book page access Custom (Regex)
When you click the +New filter, you get four options. You can choose either of those inquiry or the book page Option to use regex in GSC.
Click on that Queries included Drop-down menu to access the Custom (Regex) Option in dialog box with Filter and Compare tabs.
Step 5: Enter the regex in the Custom (Regex) Set up
Clicked once Custom (regex), you will get an empty field to enter your regex. Enter your regex here and click Apply to view the custom results.
You can either match the results that contain the regex string or filter them out using Does not match regex Possibility.
Google Search Console has a limit of 4,096 characters for regex strings.
Step 6: Export Regex Data
Click on that export Option in the top right corner to export the data to a spreadsheet or CSV file for further editing.
4 Regex examples to help you get the most out of Search Console data
Regex queries only work if your site has significant search impressions from which to glean data. Here are some commonly used regular expressions for manipulating website data.
1. Regex for questions in search queries
This regex string will show all question-related searches your site was shown for. Add more question modifiers like “should”, “would”, “won’t”, etc. to the query to get more results.
Use the resulting data to create short posts targeting Google’s featured snippets section, long blog posts that answer queries with sparse results, understand user intent to click on your site, and inspiration for content ideas.
Sort by click count to find posts with low click through rates to improve the content you provide on these topics.
2. Regex for finding long-tail keywords
This regex string results in searches of six or more words that imply a proper sentence or question.
This regex string results in searches of six or more words that imply a proper sentence or question. You can change the number 5 to any other number to shorten or lengthen the query string to find more long-tail keywords.
Use high-volume, long-tail keywords as H2s in blog posts to boost your site’s search rankings.
3. Regex to match misspelled keywords
This sample query matches all misspellings and variations of the name Elizabeth. You can create similar regex to find brand related information e.g. B. Misspelling data for common brand names, keyword variations, etc.
A ? after a letter indicates that the letter may or may not appear in the string. Use the or function | to include all possible combinations for commonly substituted vowels or consonants. Add to (?-I) to your query if you want to be case sensitive.
put in front ^ to your query to match or append keywords beginning with your string $ to match keywords ending with your regex string.
Use this helpful regex101.com testing tool to verify that your regex query is working as intended.
4. Regex to parse subdirectory search data
This sample regex shows the performance of all URLs for a given subdirectory, along with data about the search queries that triggered those results.
Use this query format in conjunction with your URL structure to find data on product groups, product categories, top selling brands, and more.
Copy and save the URL for useful regex queries to run again with a single click.
Optimize your website’s performance with Regex
You can use regex in GSC to analyze query-related data or page performance metrics to improve your site’s search performance. Once you master the art of using regex, use it for other purposes like software testing, HTML form validation, and more.