Connect with us


How to Block Bots From Coming to Your Website: Tools & Tips



If you have a website, you need to know what bots are and how they can find your site, as well as what they can do (either intentionally or indirectly) to cause frustration to your online marketing efforts. Blocking bots may be a necessity to protect your site’s speed, users, and security.

Let’s talk about what bots are and how you can put up some defenses to start protecting your website.

What Are Bots, and How Can They Be Bad?

Before we dive into the details of what they can do and how you can stop them, we need to take a step back and explore what a bot is.

A bot is a software script that performs a data task over and over again. It’s that repetition and data interaction that makes them a fellow member of the online world we interact with.

Some of the other names you hear bots associated with help explain what bots are and how they work. Think of terms like spiders, crawlers, or web bots.

Are They All Bad?

There are a couple of misconceptions we can set aside right away.

Even though the term is short for robots, bots are not robots in the form of metal, gears, and computers. They are bits of script, as we discussed, that run continuously over the data of websites or other online platforms.

Also, they are not necessarily maliciously driven by a hacker or person with ill intent. Sometimes they’re neutral or even useful, such as bots used by search engines to index websites.

How Do Bots Work?

As we mentioned above, bots are generally bits of software script that repeat a task over and over again. An outside person, either friend or foe, may deploy these to accomplish a specific task.

However, bots are getting “smarter,” so to speak, and some are created with artificial intelligence (AI) or machine learning technology. Some examples of these are chatbots for e-commerce that brands can use to learn from human interaction and deliver a better customer

service experience for their audience.

Here’s an example of an e-commerce chatbot on the ModCloth website:

block bots - modcloth chatbot example

What Do Bots Do?

As we’ve said, bots can be useful, such as indexing for a search engine or improving customer experiences.

They can also be malicious and cause trouble for your website or other web presence. Some bots are intended to crawl websites and steal data like passwords, identifiable information, or personal data. They can also deploy malicious attacks on websites, computers, and other places. Some get sophisticated, unfurling a series of steps to cause chaos for another user or organization.

They can also be used to surge interactions online. This may come in the form of flooding a page or forum with comments, driving up purchases or popularity of something to stir up interest, bumping up social media interaction to improve views, or other ways to “game the system.”

These are often the ways you may start to see bot activity on your website.

How Can You Tell If Your Website Has Bot Traffic?

Do you need to block bots on your website? Here are some signs and how to check.

See also  Google Responds to Criticism Regarding Desktop Search Changes

Red Flags You May Need to Block Bots

There are some signs that bots have been to your website, and those may be the first place to start. Here are a few to look for:

  • excess commenting in your blog or other pages
  • comments that don’t seem readable or human-generated
  • comments with excessive linking or obvious spam
  • excessively or suddenly high bounce rates on a particular page
  • a sudden surge of sign-ups for your newsletter or other forms
  • email sign-ups that don’t seem human-generated
  • log-in attempts from unknown sources
  • any other activity that appears fishy

Where Can You Check to Block Bots?

If you have a gut reaction that you need a bot blocker, you can do a deeper dive to determine whether bots are a problem for your website and whether it’s worth investing time to block bots.

Here are a few places to explore:

  • Google Analytics to investigate traffic on your site
  • A service like Copyscape to check if your content was plagiarized somewhere else
  • your web server logs to learn more about where people are coming from

10 Steps to Block Bots From Coming to Your Website

Trying to block bots from coming to your website can feel a little like trying to put up an invisible shield around your site to ward off invaders.

While it’s not quite so fanciful, taking steps to keep bots from invading and causing chaos on your website is about being proactive and putting processes into place ahead of any problems.

It starts with understanding the enemy, removing any current problems, and then preparing for future attacks. Here are some steps you can take:

1. Identify the Weight of the Problem

If you’re reading this far, you probably have some concerns about bots and want to know more about how to block website bots. Before jumping in, though, it’s always good to consider what’s happening on your website.

Are you having a significant problem with bots, or are you just noticing some increased activity?

Further, consider what the impact has been or could be on your online marketing efforts. As we mentioned above, some bots are good, and some are bad. Some are just neutral.

For instance, you might have a bump in activity on your website on a given day or a given page for no apparent reason. You can’t link them to a specific marketing campaign that promoted that page and caused a spike. The surge in activity may have come from a bot.

If the surge was short-lived and you haven’t seen any other issues, it may be worth looking into but may not warrant extreme or rushed reactions.

On the other hand, if you’ve found your e-commerce site was hacked, or if parts of your website have been infected and are no longer functioning properly, you probably want to act quickly to batten up the hatches and clean up your website. If that’s the case, you may want to jump to the later steps here and start taking immediate action.

2. Understand the Source

Once you realize that web bots have been bothering your website, you’ll need to go on a bit of an investigation to find out where they’re coming from.

See also  5 Examples of Awesome Mobile Landing Pages

I listed above some places that can help you explore whether bots are attacking your website. They can also help you figure out the origin of those bots.

For example, in Google Analytics, your web server access logs, or any log-in attempt emails, you may be able to see data related to those visiting your site. You can check for a pattern or a series of the same IP address repeatedly.

3. Make a Plan

Now it’s time to decide what to do.

If you’ve already suffered an attack, you’ll need to take steps to clean up the problem and patch any vulnerabilities in your site to avoid further problems.

If you’ve been seeing bot activity but haven’t been attacked, you should focus your plan on looking for vulnerabilities that could be exploited in the future and tighten them up now.

4. Stay Up to Date

Keep your website and all its integrations up to date with the latest releases. Whichever website CRM provider you use, ensure you’re staying current with that platform’s releases. For instance, if you use WordPress, you need to ensure that your theme and plugins have the latest updates.

Staying up to date has its advantages. First, bots may use older versions to gain access. Further, platforms are motivated to provide secure products to their customers. The latest updates may come with increased security features and bot blocker options.

5. Add CAPTCHA Tools

One way to block bots from interacting with parts of your websites (such as sign-ups, contact pages, and purchase options) is to ensure that only humans can perform those actions.

CAPTCHA forces the user to perform a challenge or other action to prove they’re not a bot. Unless a bot has the correct action written into their script, they won’t finish this task and move on.

Here is an example of a CAPTCHA you’ve probably seen before:

Block Bots From Coming to Your Website - Add CAPTCHA Tools

6. Check Your APIs and Other Connections

Especially if your website is a few years old, you may have installed many API integrations and other connections to other web platforms. If you’ve permitted that integration to connect with and share data with your website, APIs could be an area of vulnerability.

Conduct an audit of every API, plugin, connection, or other integration:

  • Do you use them all? Remove the obsolete ones.
  • Are you using the latest versions? If not, update them.
  • Are you using quality products? If they don’t have security measures in place, consider replacing them.

If you have questions, reach out to the platform owner and make sure they are secure.

7. Block Older Browser Versions

This is not foolproof, but another way to close up some ways bots can access your website is by blocking older versions of browsers from accessing your website. You might achieve this by requiring users to use new versions of browsers to view your website.

TechRepublic encourages using this method as most human users will be forced to update to a newer browser version.

This requires accessing and updating the .htaccess file of your website, so unless you are experienced with coding, we recommend engaging with a web developer for this.

See also  How to reach more potential customers using social media

8. Patch It

If you’re struggling to stay up to date with the bots coming to your website or feel like the problem may be bigger than you want to control, you can turn to a professional to start digging deeper into bots that may be heading to your website.

If you notice a specific bot that keeps arriving at your website and causing problems, such as offensive comments or attempts to gain unauthorized access, you can block that IP address from gaining access to your website in the future.

Many web hosts, such as GoDaddy, provide detailed information about how to accomplish this task. However, you should know that this is only a patch. It can stop a rather insidious attack in its tracks, but many hackers or malicious bot launchers have ways of coming in from other IP addresses, so the solution may not hold long-term.

Also, Hubspot reminds us that blocking an IP address means blocking all access from any person or bot from that IP address, so weigh the pros and cons before making a decision.

9. Keep Up With It

For a long-term solution, you may choose to pay for a bot blocker service. Although there are many different options, they all promise you a bit of peace of mind as their integrated solution stays on your website, comparing visitors with their information to watch for and alert you of any problems. A few options include:

  • DataDome
  • Cloudflare
  • Radware Bot Manager
  • ClickGUARD
  • Google ReCAPTCHA

10. Ongoing Monitoring

Bot blocking isn’t a one-and-done situation. You will need to continue to monitor your website for any problems.

You can watch for any of the problems discussed above and take steps to close up any holes. You may want to add this to your calendar to check in monthly or quarterly.

You can also keep an ear out for public data breaches. If you hear of any wide-scale attacks, take a look at your website and look for signs of any bot activity.


As AI in marketing continues to grow, our discussion of blocking bots, as well as adding them to our marketing stack, will likely increase as well. Bots can be helpful in our digital work and can support our digital marketing strategy.

They can also be malicious and attack your website at any time. The best way to block bots is to stay vigilant and keep your web presence up to date and cleaned up.

Don’t let vulnerabilities like outdated plugins or open access ports linger, inviting opportunistic bots. Monitor as you go and consider hiring an outside third party if the problem or the risks start getting bigger than you want to handle.

What’s the first step you’re going to take to block bots?

See How My Agency Can Drive Massive Amounts of Traffic to Your Website

  • SEO – unlock massive amounts of SEO traffic. See real results.
  • Content Marketing – our team creates epic content that will get shared, get links, and attract traffic.
  • Paid Media – effective paid strategies with clear ROI.

Book a Call


Which Is Better for SEO?



Which Is Better for SEO?

Long-form content isn’t necessarily better for SEO than short-form content. As with many things in SEO, it depends.

Sometimes, long-form content is overkill and a waste of resources. Other times, it’s necessary to stand the best chance of ranking.

In this guide, you’ll learn a simple way to figure out how much to write on a topic-by-topic basis.

But first, let’s get our definitions straight:

What is short-form content?

Short-form content is roughly anything under 1,000 words. This is how we choose to define it, but definitions vary. You may only consider something under 500 words to be short-form content, and that’s fine.

What is long-form content?

Long-form content is roughly anything over 1,000 words. Again, this is how we choose to define it. You may disagree and only see something as long-form content if it’s over 2,000 words. It’s up to you.

Should I write short-form or long-form content?

If you’re asking this question in the context of SEO, then what you’re probably asking is, “Do I need to write thousands of words to rank for this keyword? Or can I write something shorter?”

Fair question. But you shouldn’t decide this by setting an arbitrary word count.

Instead, ask yourself, “How much do I need to write to satisfy searchers?”

Here’s a straightforward way to answer that question in five steps:

1. Look at what’s ranking

Pull up the search results for your target keyword. You can do this in a couple of ways.

If you’re an Ahrefs user, use Keywords Explorer and scroll down to the SERP overview:

SERP overview for "ecommerce seo"

If you’re not an Ahrefs user, search on Google in an incognito tab and use Ahrefs’ SEO Toolbar to view results for your target location.

Google search results for "ecommerce seo"

2. Pick a content format

Your content is unlikely to rank unless it aligns with what searchers want, regardless of how much you write. This is why it’s usually best to choose a content format that is already ranking.

Here are a few popular content formats to look out for:

  • Guides
  • Listicles
  • How-tos
  • Tutorials
  • Reviews
  • Definitions
  • Vs.” posts

For example, if we look at the blog posts ranking for “ecommerce seo,” they’re pretty much all guides…

SERP overview for "ecommerce seo"

… so it’s clear that we should also write a guide.

If we look at the posts ranking for “keyword cannibalization,” we see a mix of definitions and how-tos:

SERP overview for "keyword cannibalization"

This is known as a mixed intent keyword.

With mixed intent keywords, it’s up to you which format to create. Just keep in mind that some content formats will give you a better opportunity to promote your business than others.

For example, since you’re able to find keyword cannibalization issues using our tool, it makes more sense to write a how-to than a definition post.

See also  How Google Identifies Individual Passages of a Web Page

3. Create a search-focused outline

A search-focused outline is a barebones plan for your content that takes inspiration from similar top-ranking content. The logic here is that similar top-ranking content is clearly satisfying searchers, so analyzing it can help you understand what they want.

The best starting point for a search-focused outline is a content gap analysis.

Let’s say we want to create a guide targeting the keyword “pour over coffee.”

If we take the top-ranking guides and plug their URLs into Ahrefs’ Content Gap tool, we see all the keywords that one or more of those pages rank for in the top 10. By eyeballing these keywords, we can start to pluck out subtopics that we can include in our outline:

List of keywords in Content Gap results
Initial outline for "pour-over coffee" article

If you need more inspiration for your outline, visit the pages themselves and eyeball their subheadings. This will also help you better understand how to structure your content and may unveil subtopics you missed.

For example, if we open two top-ranking guides for “pour over coffee” and use Ahrefs’ SEO Toolbar to view the subheadings, we see they both talk about equipment:

List of subtopics
List of subtopics

This is likely an important thing to include.

We can also see that both guides start with a definition. This makes total sense and is probably the best starting point for any guide to pour-over coffee.

Here’s what our final search-focused outline may look like for this topic:

Revised outline for "pour-over coffee" article

4. Start writing

It’s finally time to put pen to paper and transform your outline into “content.”

This is where you get to unleash your creativity and share your knowledge with the world. Just remember not to stray too far from your outline, as it’s there to ensure you cover what is needed to satisfy searchers.

Don’t worry about word count or length at this stage. Just focus on getting your thoughts down.

Here are a few useful tips if you’re struggling:

  1. Freewrite – This is where you write and don’t stop. No backspacing to correct spelling mistakes. No rewriting sentences. Just write. You’ll probably find that your content flows better if you can master this.
  2. Use the Pomodoro technique – This is where you write for 25 minutes before taking a five-minute break. Repeat this process as many times as necessary to get your content done. (Here’s a free Pomodoro timer.) 
  3. Use a distraction-free writing tool Bear is my favorite, but there are a few similar apps.

Whichever app you use, I don’t recommend using one that shows the word count as you type. It’s too distracting and may cause you to slip into thinking, “Hey, this is getting long” or “Hey, this seems too short.”

See also  Google Discover Now Excludes 5 Kinds of Content

This is the kind of thinking you want to avoid. You just want to write as much as you need and no more. Don’t even look at the word count.

5. Trim the fluff

Regardless of whether your content ends up being short-form or long-form, your first draft will always be way too long. It’ll have run-on sentences, points that nobody cares about, and overly long paragraphs.

That may seem bad, but it’s exactly what a first draft should look like. You’ll find it much easier to trim and refine your ideas once they’re down on paper than to obsess over them as you go.

Here’s how to do that in three steps:

The first step is self-editing. This is where you go through your first draft and cut any unnecessary fluff. You should also rewrite any meandering sentences and make sure things are as concise as possible. Tools like Hemingway and Grammarly can help with this.

Longer paragraph next to a more concise version

The second step is to get a friend or colleague to provide feedback. This can be a tricky one, as most people won’t want to hurt your feelings. I recommend explicitly asking them for feedback on things you can cut or shorten. This should make their feedback more focused and reduce their anxiety about offending you.

The third and final step is a round of self-edits based on your friend’s or colleague’s feedback.

Whatever your word count is now, that’s how long your content needs to be. Maybe it’s long-form; maybe it’s short-form. It doesn’t matter. What matters is you’ve written what is required to meet searchers’ expectations.

Is it really this simple?

Kind of—although there are a few other factors to keep in mind that may influence your decision.

You shouldn’t repeat yourself

Let’s say you’re researching subtopics for a content piece and find one that you’ve already covered on your site.

For example, our beginner’s guide to link building primarily targets the keyword “link building.” If we plug two top-ranking guides for this keyword into Ahrefs’ Content Gap tool, we see that searchers want to know about link building strategies and techniques:

List of keywords in Content Gap results

But here’s the thing: We’ve already published dedicated guides about most of these strategies:

For that reason, we decided not to regurgitate everything in this guide and make it unnecessarily long. Instead, we chose to keep things brief and link to our guides on each tactic in case the reader wants to learn more.

Excerpt of blog post showing list of links

Then in each “sub-post” about an individual tactic, we added a link back to our link building guide.

Excerpt of blog post showing link to guide

This is known as a topic cluster or content hub, and there are a few reasons why it can be beneficial to SEO.

See also  Google Responds to Criticism Regarding Desktop Search Changes

You can write multiple posts targeting multiple intents

Let’s take a keyword like “guest blogging.”

If you look at the SERP, it’s a mix of definitions and guides:

SERP overview for "guest blogging"

The definitions are generally short-form, and the guides are long-form.

Although you could pick one format to create here, you might also want to consider creating multiple posts in different formats to try to win multiple rankings. In this case, that would mean creating a short-form definition-type post and a long-form guide.

Yoast did this successfully for the keyword, “canonical URL”:

Google search result for "canonical url" showing Yoast's article first

You may want to approach competitive keywords differently

Let’s say that you’re targeting a super competitive keyword like “SEO.” We see a mix of definitions and guides in the SERP, but pretty much all of them have backlinks from thousands of websites:

SERP overview for "seo"

Most of these pages are old, have accumulated their backlinks over many years, and continue to earn backlinks thanks to the vicious cycle of SEO:

SEO cycle: People search & read #1 result, then link to that result on own site, then these new links cause #1 page to stay on top

Bottom line: If you want to rank for this keyword, you’re going to need a ton of backlinks.

In this case, you’ll probably struggle to do that by following the crowd with a search-focused piece of content. You’ll stand a better chance of attracting the links you need by publishing something interesting or innovative (and ideally then doing outreach for links).

Note that this doesn’t mean you need to publish long-form content. Long-form guides can be link magnets, but so can short-form pieces.

For example, take Aleyda’s

Roadmap with links to free resources

The original version of this (pictured above) was published in February 2021 with just 114 words on the page. Yet it’s managed to attract links from over 560 referring domains in only nine months:

Graph showing increasing number of referring domains over 9 months

My guess is that Aleyda isn’t trying to rank for anything here (especially not “SEO”) and simply created this to give back to the community. But the point remains: If you want links, it’s not about short-form vs. long-form. It’s about creating something that resonates with people and putting it in front of them.

Final thoughts

Focus on satisfying searchers, not hitting some arbitrary word count.

If you’re working with freelancers and need to give them a ballpark figure because you’re paying by the word, let your search-focused outline guide you. If there’s not much ground to cover, tell them to keep it short and sweet. If there’s a lot to cover, give them a rough limit and have them tell you if the content needs to be longer. Giving a bit of flexibility is key here.

Got questions? Disagree? Ping me on Twitter.

Source link

Continue Reading


Google Changes Recipe Structured Data Guidance



Google Changes Recipe Structured Data Guidance

Google’s recipe structured data requirements have changed. The old way of structured data is no longer valid and Google requires updating the recipe structured data to the latest requirements.

Recipe Structured Data

Recipe structured data is information that publishers communicate to search engines like Google in order to help them better understand the content. Structured data also allows Google to display the content in engaging ways that call attention to the recipes called Recipe Enhancements.

Typical Recipe Enhancements are:

  • Guided Recipes
  • Recipe host carousel

Using valid structured data is important. Failure to use correct structured data could cause a site to lose eligibility for being shown in Recipe Enhancements and the subsequent loss of search engine traffic to other sites that do use the correct structured data.

Three Recipe Structured Data Properties Changed

Google’s documentation states that they removed their guidance for specifying a time range for the cookTime and prepTime properties.

The following wording is removed from the cookTime property recommendation:

“You can use min and max as child elements to specify a range of time.”

The following wording was removed from the prepTime property:

“You can use min and max as child elements to specify a range of time.”

Google now only supports exact time for both the cookTime and prepTime properties and one more that Google did not document.

The range of time is no longer supported.

The changelog for the update states:

“Currently, the only supported method is an exact time; time ranges aren’t supported. If you’re currently specifying a time range and you’d like Google to better understand your time values for cook time and prep time, we recommend updating that value in your structured data to a single value (for example, “cookTime”: “PT30M”).”

A Third Structured Data Property Changed

Google’s changelog documentation states that only two properties have changed, the cookTime and prepTime properties.

See also  Why SEO and Copywriting Go Hand in Hand

However there is actually a third property that has also changed.

This is what the changelog states:

“Removed guidance about specifying a range for the cookTime and prepTime properties in the Recipe documentation.”

Although Google’s changelog documentation doesn’t mention it, the totalTime property has also changed.

The previous totalTime Recipe documentation states:

“You can use min and max as child elements to specify a range of time.”

Here’s a screenshot of the documentation from January 4, 2022:

Previous totalTime Recommendation

The new documentation omits the above quoted time range recommendation altogether.

New totalTime Recommendation

New totaltime recipe structured data

So although Google’s documentation omits noting the change in the totalTime property, it’s probably prudent to take note that this property has also changed and moving forward to not include a time range for the totalTime property since Google is no longer recommending it.

Recipe Structured Data

Many recipe sites rely on plugins for their structured data. If you use a recipe structured data plugin that also uses the time range, it may be useful to update the current plugin to the most recent version to make sure that your recipe structured data is up to date.

This change in the structured data is very new, it was updated on January 18, 2022.


Google Changelog – See January 2022

Google Recipe Structured Data Page January 4, 2022

Current Google Recipe Structured Data Page

Source link

Continue Reading


A Guide To Regular Expressions (With Use Cases)



A Guide To Regular Expressions (With Use Cases)

Perhaps you’ve heard of regex but aren’t quite sure how it can be used in SEO or whether it fits into your own strategy.

Regular expressions, or ‘regex’, are like an in-line programming language for text searches that allow you to include complex search strings, partial matches and wildcards, case-insensitive searches, and other advanced instructions.

You can think of them as searching for a pattern, rather than a specific string of text.

Therefore, they can help you to find entire sets of search results that, at first glance, may appear to have little in common with each other.

Regex expressions are a language all their own and the first time you see one, it can look quite alien.

But they are quite easy to learn and can be used across JavaScript, Python and other programming languages, making them a versatile and powerful SEO tool.

In this guide, you’ll learn common regex operators, how to use more advanced regex filters for SEO, how to use regex in Google Analytics and Google Search Console, and more.

You’ll find examples of regex at work in different ways in SEO, too.

What Does Regex Look Like?

A regular expression typically includes a combination of text that will match exactly in the search results, along with several operators that act more like wildcards to achieve a pattern match rather than an exact text match.

This can include a single-character wildcard, a match for one or more characters, or a match for zero or more characters, as well as optional characters, nested sub-expressions in parentheses, and ‘or’ functions.

By combining these different operations together, you can build a complex expression that can achieve very far-reaching, yet very specific results.

Common Regex Operators

A few examples of common regex operators include:

.         A wildcard match for any single character.

.*       A match for zero or more characters.

.+      A match for one or more characters.

d        A match for any single numerical digit 0-9.

?        Inserted after a character to make it an optional part of the expression.

|        A vertical line or ‘pipe’ character indicates an ‘or’ function.

^       Used to denote the start of a string.

See also  12 Important Image SEO Tips You Need To Know

$        Used to denote the end of a string.

( )      Used to nest a sub-expression.

        Inserted before an operator or special character to ‘escape’ it.

Some programming languages, such as JavaScript, allow the inclusion of ‘flags’ after the regex pattern itself, and these can further affect the outcome:

g        Returns all matches instead of just the first one.

i         Returns case-insensitive results.

m       Activates multiline mode.

s        Activates ‘dotall’ mode.

u        Activates full Unicode support.

y        Searches the specific text position (‘sticky’ mode).

As you can see, together these operators and flags start to build up to a complex logical language, giving you the ability to achieve very specific results across large, unordered data sets.

How Do You Use Regex For SEO?

Regex can be used to explore the queries different user segments use, which queries are common to specific content areas, which queries drive traffic to specific parts of your site, and more.

In this article, Hamlet Batista demonstrated how to use regex in Python to analyze server log files, for example.

And in this one, Chris Long showed you how to use regex to extract the position, item, and name of the breadcrumbs associated with each URL of your site as part of a scalable keyword research and segmentation process.

Google encourages SEO pros to share examples of how they’re using regex on Twitter using the hashtag #performanceregex.

Here are a couple tips from SEO Twitter (you’ll notice it’s a pretty quiet hashtag – add your own examples if you have them!):

Using Regex On Google Analytics

One of the most common uses of regex for SEO is in Google Analytics, where regular expressions can be used to set up filters so that you only see the data you want to see.

See also  Google: Structured Data Has No Impact on Ranking in Web Search

In this sense, the expression is used to exclude results, rather than to generate a set of inclusive search results.

For example, if you want to exclude data from IP addresses on your local area network, you might filter out 192.168.*.* to remove the full range from to

More Advanced Regex SEO Filters

As a more complex example, let’s imagine you have two brands: regex247 and regex365.

You might want to filter results that match any combination of URLs that contain these brand names, such as or

One way to do this is with a fairly simple ‘or’ expression:


This would remove all matching URLs from your Analytics data, including subfolder paths and specific page URLs that appear on those domain names.

A Word Of Warning

It is worth noting that – similar to your robots.txt file – a poorly written regex expression can quite easily filter out most or all of your data by including an unrestricted wildcard match.

The good news is that in many SEO cases, the filter is only applied to your data at the reporting stage, and by editing or deleting your regex expression, you can restore full visibility to your data.

You can also test regular expressions on a number of online testing tools, in order to see if they achieve the intended outcome – allowing you to ‘sandbox’ your regex expressions before you let them loose across your entire data set.

To create regex filters on Google Analytics, first, navigate to the type of Report you want to create (e.g. Behaviour > Site Content > All Pages or Acquisition > All Traffic > Source/Medium).

Below the graph, at the top of the data table, look for the search box and click advanced to display the advanced filter options.

Here you can include or exclude data based on a particular dimension or metric. In the dropdown list after you select your dimension, choose Matching RegExp and then enter your expression into the text box.

See also  Free WordPress Astra Plugin Updated with Gutenberg Wireframe Blocks

‘Or’ And ‘And’ In Google Analytics Regex

To create an ‘or’ expression in Google Analytics, just include the pipe character (the | vertical stroke symbol) between the appropriate segments of your expression.

Google Analytics regular expressions do not support ‘and’ statements within a single regex; however, you can just add another filter to achieve this.

Below your first regex, just click Add a dimension or metric and enter your next regex. In this way, you can stack as many expressions as you want and they will be processed as a single logical ‘and’ statement when filtering your data.

Using Regex In Google Search Console

In 2021, Google Search Console began supporting the Re2 syntax of regex, allowing webmasters to include and exclude data within the user interface.

You’ll find all metacharacters supported by Google Search Console in this RE2 regex syntax reference on GitHub.

At the time of writing, there is a character limit of 4096 characters (which is usually enough…).

Examples you can use in Search Console can be filtering for queries containing a specific brand and the variations users could type, such as Facebook:


Filter out users finding your website through “commercial” intent terms:


Related: Google Search Console Adds New Regex Filter Options

Why Is Regex Important For SEO?

Finally, why does all this matter?

Well, it’s all about taking control of your data and filtering out the parts of it that don’t help you to improve your SEO – whether that’s particular pages or parts of your website, traffic from a specific source or medium, or your own local network data.

You can create quite simple regex expressions to achieve a basic ‘include’ or ‘exclude’ filter, or write longer expressions that work similarly to programming code to achieve complex and very specific results.

And with the right regex for each campaign, you can verify that your SEO efforts are achieving your aims, ambitions, and outcomes – a powerful way to prove positive ROI on your future SEO investments.

More resources:

Featured Image: Optura Design/Shutterstock

Source link

Continue Reading

Subscribe To our Newsletter
We promise not to spam you. Unsubscribe at any time.
Invalid email address