Use Web Application Firewall rules to block or allow traffic before it reaches your site.
Not every visitor to your site is someone you want there. Bots, scrapers, and traffic from regions you don’t serve can eat up bandwidth and slow things down. You can set Web Application Firewall (WAF) rules to decide who gets in, so you can stop unwanted traffic before it ever reaches your site.
Before you get started
WAF rules are available on Enterprise plans. Your site needs a custom domain to set rules. Admins, Designers, and Limited Designers can add and edit rules. Branch Designers, Marketers, Editors, and Reviewers can view them.
How WAF works
WAF checks each incoming request against your rules and either lets it through or blocks it. You can filter by IP address, country, Autonomous System Number (ASN), and User-Agent. You can combine all four rule types to build the traffic policy your site needs.
Rules apply to every connected custom domain by default, and you can limit a rule to specific domains. Rules don’t apply to your .webflow.io URL.
Two layers of protection: Webflow automatically applies account-level security rules to all sites. These always run first and can block traffic before your rules are evaluated. The rules you add provide extra, site-specific protection on top. If you haven’t added any rules, only Webflow’s rules apply.
Bot bypass
Bot bypass controls whether certain bots can skip your WAF rules. When Bot bypass is enabled, these two groups skip all of your rules:
-
Cloudflare-verified bots: trusted crawlers like Googlebot and GPTBot, which are on Cloudflare’s maintained list
-
Bots from Webflow-approved providers: bots that send a token from a provider Webflow approves. Webflow manages these providers and their tokens.
Keeping Bot bypass enabled means a new rule doesn’t accidentally remove your site from search results. If you turn it off, your rules apply to both groups, which can affect search engine indexing. To block a verified crawler with a User-Agent rule, like an AI crawler, turn Bot bypass off first.
Evaluation order
WAF checks each request in a set order. Knowing the order helps you predict what happens when you use more than one rule type.
Every request goes through these steps, in this order:
-
Webflow platform rules: account-level rules Webflow applies to every site, including general security protections and, in some cases, trust and safety actions
-
Bot bypass: when it’s enabled, the bots it covers skip all of the rules that follow
-
IP rules: specific addresses or ranges
-
Country rules: where the visitor is located
-
ASN rules: the network the visitor connects from
-
User-Agent rules: the browser or bot the visitor uses
If a rule blocks a request, WAF stops checking and turns the visitor away. The remaining steps never see that request. For example, if your country rule blocks a visitor’s country, WAF doesn’t check their ASN or User-Agent.
BLOCK and ALLOW
Every rule uses one of two modes:
-
BLOCK: denies the traffic you list and lets everything else continue to the next step
-
ALLOW: denies everything you didn’t list, so use it when you want an explicit allowlist, such as one country or one IP range
An ALLOW match doesn’t grant full access to your site. The request continues through the remaining rule types and can still be blocked at a later step. For example, a request that matches an IP ALLOW rule can still be blocked by a country, ASN, or User-Agent rule.
Important
A short ALLOW list can lock out legitimate visitors, including you. For country and ASN rules, ALLOW also blocks every country or network you didn’t list, along with requests that have no country or ASN data. When in doubt, use BLOCK.
Add a WAF rule
Rules are written as JSON in a code editor. You can review the full details for each rule type below.
To add a rule:
- Go to Site settings > Security
- In the Rules section, click Add rule
- Choose a rule type: IP blocking, Geo-blocking, ASN blocking, or User-Agent filtering
- Click Use example to start from a sample configuration, or type in your own JSON
- Edit the JSON for your site
- Click Test change to check your configuration
- Click Add rule
Changes can take a few minutes to apply to your connected domains, and you don’t need to publish your site. Each rule you add appears in the Rules section with a summary. Click the arrow next to a rule to see its domains, mode, and entries.
Review high-risk changes
If a change could block nearly all traffic to a domain, such as a country allowlist, WAF asks you to review and confirm it before it applies. The Review high-risk WAF change dialog lists each risk and the exact domains the change affects.
To apply the change:
- Check the box for each risk
- Type in the confirmation phrase, e.g.,
APPLY TO 1 DOMAIN
- Click Apply high-risk change
While a rule that can block nearly all traffic is active, a red warning banner appears above your rules. The banner goes away when you remove the rule.
Edit a WAF rule
To edit a rule:
- Go to Site settings > Security
- In the Rules section, click the Edit icon for the rule
- Edit the JSON
- Click Test change
- Click Save changes
Delete a WAF rule
To delete a rule:
- Go to Site settings > Security
- In the Rules section, click the trash icon for the rule
- Review the domains listed in the dialog
- Click Delete rule
Deleting a rule can’t be undone. It removes that rule type from the domains listed in the dialog, and your other rule types aren’t affected.
Limit a rule to specific domains
By default, a rule applies to every connected custom domain. To limit it, add a domains array with one or more connected domains.
{
"domains": ["staging.example.com"],
"countryList": ["RU", "CN"],
"mode": "BLOCK"
}
Keep these points in mind:
- Saving a scoped rule replaces that rule type on the domains you list
- If you remove domains from an existing scope, Webflow shows which domains will lose the rule before you save
- To keep different configurations on different domains, save each group of domains separately
- Unknown or disconnected domains are rejected
Rule types
IP blocking
Use IP rules to stop a known bad actor or a small range of addresses. IP rules support up to 100 IPv4 and IPv6 addresses and CIDR ranges. A bare address matches only that exact IP, and a CIDR range matches every address in the range. IPv4 entries match only IPv4 visitors, and IPv6 entries match only IPv6 visitors.
{
"ips": [
{ "ip": "203.0.113.4", "mode": "BLOCK" },
{ "ip": "2001:db8::/32", "mode": "BLOCK" }
]
}
Fields:
-
ip (required): the IPv4, IPv6, or CIDR range to match
-
mode (required): BLOCK or ALLOW
-
domains (optional): limits the rule to specific connected domains
-
paths (optional): limits the entry to specific URL paths
IP rules run before country, ASN, and User-Agent rules. The first matching entry wins. An ALLOW match skips the remaining IP entries, but the request still runs through the later rule types. To allow one address inside a blocked range, put the ALLOW entry first:
{
"ips": [
{ "ip": "203.0.113.4", "mode": "ALLOW" },
{ "ip": "203.0.113.0/24", "mode": "BLOCK" }
]
}
Geo-blocking
Use geo-blocking to allow or block visitors based on their country of origin. List up to 250 countries with their two-letter ISO country codes, such as US, GB, or CN.
{
"countryList": ["RU", "CN"],
"mode": "BLOCK"
}
Fields:
-
countryList (required): the countries to include in the rule
-
mode (required): BLOCK blocks the listed countries and lets requests with no country data continue. ALLOW blocks every unlisted country and requests with no country data.
-
domains (optional): limits the rule to specific connected domains
-
paths (optional): limits the rule to specific URL paths
ASN blocking
An ASN identifies the network operator that announces an IP range. ASN rules work well for stopping bot and scraper traffic from cloud hosting providers. You can block or allow up to 100 networks. ASN is also harder to spoof than User-Agent, because visitors can’t change which network their traffic comes from.
{
"asnList": [16509, 14061],
"mode": "BLOCK"
}
Common cloud and hosting ASNs:
- 16509: Amazon Web Services (AWS)
- 14061: DigitalOcean
- 24940: Hetzner
- 16276: OVH
Fields:
-
asnList (required): the ASNs to include, as numbers
-
mode (required): BLOCK blocks the listed ASNs and lets requests with no ASN data continue. ALLOW blocks every unlisted ASN and requests with no ASN data.
-
domains (optional): limits the rule to specific connected domains
-
paths (optional): limits the rule to specific URL paths
User-Agent filtering
A User-Agent is the name a browser or bot uses to identify itself. Use User-Agent rules to block bots and scrapers by name, or to allow only certain browsers. You can add up to 50 ordered patterns, each with optional path scopes.
Note
Verified bots, such as GPTBot, skip your rules while Bot bypass is on. Turn Bot bypass off before you rely on a User-Agent rule to block a verified crawler.
{
"blockEmpty": true,
"patterns": [
{ "pattern": "GPTBot", "matchMode": "contains", "mode": "BLOCK" }
]
}
Fields:
-
blockEmpty (optional): set to
true to block requests with a missing or empty User-Agent. A catch-all any BLOCK pattern also blocks these requests.
-
patterns (optional): the list of User-Agent rules to evaluate
-
pattern (required for
contains and exact): the text to match. Wildcards like * and ? are treated as plain text.
-
matchMode (optional): how WAF matches the pattern
-
contains: matches the text anywhere in the User-Agent, ignoring case. This is the default.
-
exact: matches the full User-Agent string, including case
-
any: matches every request, including a missing or empty User-Agent. Leave out
pattern when you use it.
-
browserVersionFloor: sets a minimum browser version, as described below
-
mode (required): BLOCK or ALLOW
-
domains (optional): limits the rule to specific connected domains
-
paths (optional): limits the pattern to specific URL paths, up to 20 per pattern
Order matters: The first matching pattern wins. If nothing matches, the request continues. Put specific ALLOW patterns before broader BLOCK patterns. If a pattern has a path scope and the request is outside it, WAF skips that pattern and checks the next one.
Create an allowlist: To block every request that didn’t match an earlier ALLOW pattern, end the list with an any BLOCK pattern. In this example, requests containing “WebApp” are allowed and everything else is blocked:
{
"patterns": [
{ "pattern": "WebApp", "matchMode": "contains", "mode": "ALLOW" },
{ "matchMode": "any", "mode": "BLOCK" }
]
}
Set a minimum browser version: Use browserVersionFloor to allow only recent versions of a browser. It supports chrome, edge, and firefox, and Safari isn’t supported. Each entry needs withinLatest, minVersion, or both, and it must leave out pattern.
-
withinLatest: accepts 1 to 100 major versions behind the latest release
-
minVersion: accepts an absolute major version from 1 to 1,000. Set it when you need a fixed floor, in case Webflow’s latest-version data is unavailable.
When you set both, the stricter floor applies. Add one entry for each browser. In this example, recent Chrome versions are allowed and all other User-Agents are blocked:
{
"patterns": [
{
"matchMode": "browserVersionFloor",
"browser": "chrome",
"withinLatest": 12,
"minVersion": 100,
"mode": "ALLOW"
},
{ "matchMode": "any", "mode": "BLOCK" }
]
}
Limit a rule to specific paths
By default, a rule applies to your whole site. To limit it to part of your site, add a paths array with up to 20 paths. Paths are case-sensitive.
{
"asnList": [16509],
"mode": "BLOCK",
"paths": [{ "path": "/content", "matchMode": "prefix" }]
}
Each path has two fields:
-
path (required): the path to match
-
matchMode (optional):
prefix (the default) matches the path and anything nested under it on a path boundary. exact matches only the full path.
Here’s how /api matches each mode:
| Request path |
prefix |
exact |
| /api |
Match |
Match |
| /api/v1 |
Match |
No match |
| /api-docs |
No match |
No match |
| /apis |
No match |
No match |
With exact, /api doesn’t match /api/ or /API.
Starter configurations
These starter configurations cover common situations, like blocking AI crawlers or limiting your admin routes to certain countries. Copy one, then adjust it for your site. Each rule editor also includes examples you can load with Use example. If you use the Webflow MCP, it includes a skill with starter configurations that also checks your syntax.
Block AI crawlers (turn off Bot bypass first):
{
"patterns": [
{ "pattern": "GPTBot", "matchMode": "contains", "mode": "BLOCK" },
{ "pattern": "ClaudeBot", "matchMode": "contains", "mode": "BLOCK" }
]
}
Block a scraper only on blog routes:
{
"patterns": [
{
"pattern": "ExampleScraper",
"matchMode": "contains",
"mode": "BLOCK",
"paths": [{ "path": "/blog", "matchMode": "prefix" }]
}
]
}
Block cloud networks across the site:
{
"asnList": [16509, 14061],
"mode": "BLOCK"
}
Block selected countries across the site:
{
"countryList": ["RU", "CN"],
"mode": "BLOCK"
}
Allow only the US and Canada on admin routes:
{
"countryList": ["US", "CA"],
"mode": "ALLOW",
"paths": [{ "path": "/admin", "matchMode": "prefix" }]
}
Block an IPv4 address and an IPv6 range:
{
"ips": [
{ "ip": "203.0.113.4", "mode": "BLOCK" },
{ "ip": "2001:db8::/32", "mode": "BLOCK" }
]
}
Rule limits
Each rule type has its own limits:
| Rule type |
Entry limit |
Path entries |
| IP blocking |
100 IPs or CIDR ranges |
20 per rule |
| Geo-blocking |
250 countries |
20 per rule |
| ASN blocking |
100 ASNs |
20 per rule |
| User-Agent filtering |
50 patterns |
20 per pattern |
Let trusted apps and webhooks through
Some apps and automated tools are legitimate but look like bots, so your rules can block them.
Webflow-approved providers: While Bot bypass is on, bots with tokens from Webflow-approved providers skip your rules. Webflow manages these providers and their tokens.
Lock down your origin: If you put your own reverse proxy in front of Webflow, you can use header-based authentication so the Webflow origin rejects requests that didn’t come through your proxy. This applies to HTML only.
Manage WAF with MCP
If you use the Webflow Model Context Protocol (MCP), you can ask an AI agent to review your site’s bandwidth and bot traffic and suggest WAF rule changes. With read and write access, the agent can propose a change, and WAF validates it before you review a preview. After you confirm, WAF applies and logs the change.
View recent WAF changes
The Recent changes section at the bottom of the Security page lists each change to your WAF rules. Every entry shows what changed, its status, who made the change, and when. For example, an entry might read “Updated Geo-blocking” with “Applied to 1 domain” underneath.
By default, the list shows the five most recent changes. To see more, choose a longer range, up to 90 days, from the dropdown. Click Show changes on an entry to see its details.
What WAF doesn’t cover
- Your
.webflow.io URL, because rules apply only to custom domains
- Images and files served from Webflow’s asset Content Delivery Network (CDN), which aren’t protected by your rules