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:
Googlebot→ Google indexing robotcurl/7.81.0→ command-line toolAhrefsBot→ SEO crawlerPostman Runtime/7.28.4→ API testing tool
💡 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:
- Open the Firewall application in your administration interface.
- Go to the User-Agent tab.
- Click New Access Rule
- Give the rule a clear name (e.g., "Curl Blocking" or "Unwanted Bots").
- Specify the reason for blocking the user agent
- Example:
curlwill block any request containing this word in its user-agent - Enable the rule
- Click Save
💡 Best practices:
- Use short but precise patterns (avoid overly generic rules).
- Always test in a pre-production environment if possible.
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:
- Create a new rule in the User-Agent tab
- Rule name:
Ahrefs Blocking - Reason for blocking:
AhrefsBot - Activate and save
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
- A user agent is declarative: a malicious bot can impersonate another bot.
- This filtering remains effective in blocking simple, undisguised cases.
- For more advanced threats, consider pairing this filter with:
- IP blocking
- or geographic filtering
💡 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.
.png)