Deploy a managed ruleset with ruleset, tag, and rule overrides
Last updated Apr 16, 2026 Customize the execution of managed rulesets with a combination of ruleset overrides, tag overrides, and rule overrides in your phase entry point ruleset.
- Add a rule to a phase entry point ruleset to execute a managed ruleset.
- Configure a ruleset override that disables all rules in the managed ruleset.
- Configure a tag override that sets an action for rules with a given tag.
- Configure a rule override that sets an action for the rules you want to execute.
Zone-level example
This example uses the Update a zone entry point ruleset operation to execute the following in a single PUT request:
- Add a rule to the
http_request_firewall_managedphase entry point ruleset that executes a managed ruleset. - Use category overrides to enable rules with
wordpressanddrupaltags and set their actions tolog. - Add a rule override that enables a single rule.
In this example:
"id": "<MANAGED_RULESET_ID>"defines the managed ruleset to execute for requests addressed to a zone ($ZONE_ID)."enabled": falsedefines an override at the ruleset level to disable all rules in the managed ruleset."categories": [{"category": "wordpress", "action": "log", "enabled": true}, {"category": "drupal", "action": "log", "enabled": true}]defines an override at the tag level to enable rules tagged withwordpressordrupaland sets their action tolog."rules": [{"id": "<RULE_ID>", "action": "block", "enabled": true}]defines an override at the rule level that enables one individual rule and sets the action toblock.
<details>
<summary>
Required API token permissions
</summary>
At least one of the following <a href="https://developers.cloudflare.com/fundamentals/api/reference/permissions/">token permissions</a> is required:
- <code>Response Compression Write</code>
- <code>Config Settings Write</code>
- <code>Dynamic URL Redirects Write</code>
- <code>Cache Settings Write</code>
- <code>Custom Errors Write</code>
- <code>Origin Write</code>
- <code>Managed headers Write</code>
- <code>Zone Transform Rules Write</code>
- <code>Mass URL Redirects Write</code>
- <code>Magic Firewall Write</code>
- <code>L4 DDoS Managed Ruleset Write</code>
- <code>HTTP DDoS Managed Ruleset Write</code>
- <code>Sanitize Write</code>
- <code>Transform Rules Write</code>
- <code>Select Configuration Write</code>
- <code>Bot Management Write</code>
- <code>Zone WAF Write</code>
- <code>Account WAF Write</code>
- <code>Account Rulesets Write</code>
- <code>Logs Write</code>
- <code>Logs Write</code>
</details>
Update a zone entry point rulesetbash
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rulesets/phases/http_request_firewall_managed/entrypoint" \
--request PUT \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{
"rules": [
{
"action": "execute",
"expression": "true",
"action_parameters": {
"id": "<MANAGED_RULESET_ID>",
"overrides": {
"enabled": false,
"categories": [
{
"category": "wordpress",
"action": "log",
"enabled": true
},
{
"category": "drupal",
"action": "log",
"enabled": true
}
],
"rules": [
{
"id": "<RULE_ID>",
"action": "block",
"enabled": true
}
]
}
}
}
]
}'
Account-level example
This example uses the Update an account entry point ruleset operation to execute the following in a single PUT request:
- Add a rule to the
http_request_firewall_managedphase entry point ruleset that executes a managed ruleset for the zoneexample.com. - Use category overrides to enable rules with
wordpressanddrupaltags and set their actions tolog. - Add a rule override that enables a single rule.
In this example:
"id": "<MANAGED_RULESET_ID>"defines the managed ruleset to execute for requests addressed toexample.com."enabled": falsedefines an override at the ruleset level to disable all rules in the managed ruleset."categories": [{"category": "wordpress", "action": "log", "enabled": true}, {"category": "drupal", "action": "log", "enabled": true}]defines an override at the tag level to enable rules tagged withwordpressordrupaland sets their action tolog."rules": [{"id": "<RULE_ID>", "action": "block", "enabled": true}]defines an override at the rule level that enables one individual rule and sets the action toblock.
Note
At the account level, the rule expression of an execute rule must end with and cf.zone.plan eq "ENT" so that it only applies to zones on an Enterprise plan.
<details>
<summary>
Required API token permissions
</summary>
At least one of the following <a href="https://developers.cloudflare.com/fundamentals/api/reference/permissions/">token permissions</a> is required:
- <code>Mass URL Redirects Write</code>
- <code>Magic Firewall Write</code>
- <code>L4 DDoS Managed Ruleset Write</code>
- <code>Transform Rules Write</code>
- <code>Select Configuration Write</code>
- <code>Account WAF Write</code>
- <code>Account Rulesets Write</code>
- <code>Logs Write</code>
</details>
Update an account entry point rulesetbash
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/rulesets/phases/http_request_firewall_managed/entrypoint" \
--request PUT \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{
"rules": [
{
"action": "execute",
"expression": "cf.zone.name eq \"example.com\" and cf.zone.plan eq \"ENT\"",
"action_parameters": {
"id": "<MANAGED_RULESET_ID>",
"overrides": {
"enabled": false,
"categories": [
{
"category": "wordpress",
"action": "log",
"enabled": true
},
{
"category": "drupal",
"action": "log",
"enabled": true
}
],
"rules": [
{
"id": "<RULE_ID>",
"action": "block",
"enabled": true
}
]
}
}
}
]
}'
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/ruleset-engine/managed-rulesets/override-examples/override-ruleset-tag-rule/#page","headline":"Deploy a managed ruleset with ruleset, tag, and rule overrides","description":"Deploy a managed ruleset with ruleset, tag, and rule overrides.","url":"https://developers.cloudflare.com/ruleset-engine/managed-rulesets/override-examples/override-ruleset-tag-rule/","inLanguage":"en","image":"https://developers.cloudflare.com/ruleset-engine/managed-rulesets/override-examples/override-ruleset-tag-rule/og.png?v=45edea5f3e2eac3a","dateModified":"2026-04-16","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Customize the behavior of managed rulesets with overrides. title: Override a managed ruleset image: https://developers.cloudflare.com/ruleset-engine/managed-rulesets/override-managed-ruleset/og.png?v=4181ba450ed1c367
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/ruleset-engine/llms.txt
Use this file to discover all available pages before exploring further.
Docs