Back to articles

How to block bots or unwanted browsers with the Firewall?

Certain bots, tools, or browsers can generate unwanted traffic on your site: excessive crawling, content scraping, poorly configured automated tests, etc. Fortunately, Fasterize allows you to block these types of requests very easily thanks to its Firewall application, via the user-agent filter. Let's take a look at how to configure an effective rule in just a few clicks.

Introduction

Some bots, tools, or browsers can generate unwanted traffic on your site: excessive crawling, content scraping, poorly configured automated tests, etc.

Fortunately, Fasterize allows you to block these types of requests very easily with its Firewall application, using the user-agent filter.

Let's take a look at how to set up an effective rule in just a few clicks.

What is a user agent?

A user agent is a text string automatically sent by a browser, robot, or HTTP tool when it accesses a website.

It allows the server to identify the origin of the request.

Some common examples:

💡 By blocking certain user agents, you prevent these specific tools or bots from accessing your site.

Use the Fasterize Firewall to block a user agent

Fasterize provides you with a dedicated tab in the Firewall application to manage these blocks.

Steps to follow:

  1. Open the Firewall application in your administration interface.
  2. Go to the User-Agent tab.
  3. Click New Access Rule
  4. Give the rule a clear name (e.g., "Curl Blocking" or "Unwanted Bots").
  5. Specify the reason for blocking the user agent
  6. Example: curl will block any request containing this word in its user-agent
  7. Enable the rule
  8. Click Save

💡 Best practices:

Concrete example: blocking a scraping bot

Let's imagine that an SEO bot like AhrefsBot generates a significant load on your site.

Here's how to block it:

Result: all requests from this bot will be automatically blocked by the firewall.

⚠️ Be careful not to accidentally block a useful bot (e.g., Googlebot, Bingbot).

Always check the reason before activating it.

Limitations and precautions

💡 Tip: Start by monitoring user agents in logs before blocking them permanently.

Conclusion

User-agent filtering is a quick and easy solution for blocking unwanted bots or tools.

With Fasterize's Firewall application, you can create targeted and reversible rules in just a few clicks to maintain control over the traffic accessing your site.

⚠️ Don't forget to save your rules after creating them, otherwise they will not be active.