Set WordPress rules to Block
Follow the steps below to create a rule that executes a managed ruleset and defines an override for rules with a specific tag.
- Add a rule to a phase entry point ruleset that executes a managed ruleset.
- Configure a tag override that sets a specified action for all rules with a given tag.
The example below uses the Update a zone entry point ruleset operation to perform the two steps in a single PUT request.
- Set the list of rules in the
http_request_firewall_managedphase entry point ruleset to a single rule that executes the Cloudflare Managed Ruleset. - Override rules with the
wordpresstag to set the action toblock. All other rules use the default action provided by the ruleset issuer.
Example: Use tag overrides to set WordPress rules to Block at the zone level
Required API token permissions
At least one of the following token permissions
is required:
Response Compression WriteConfig Settings WriteDynamic URL Redirects WriteCache Settings WriteCustom Errors WriteOrigin WriteManaged headers WriteZone Transform Rules WriteMass URL Redirects WriteMagic Firewall WriteL4 DDoS Managed Ruleset WriteHTTP DDoS Managed Ruleset WriteSanitize WriteTransform Rules WriteSelect Configuration WriteBot Management WriteZone WAF WriteAccount WAF WriteAccount Rulesets WriteLogs WriteLogs Write
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": { "categories": [ { "category": "wordpress", "action": "block" } ] } } } ] }'Example: Use tag overrides to set WordPress rules to Block at the account level
Required API token permissions
At least one of the following token permissions
is required:
Mass URL Redirects WriteMagic Firewall WriteL4 DDoS Managed Ruleset WriteTransform Rules WriteSelect Configuration WriteAccount WAF WriteAccount Rulesets WriteLogs Write
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": { "categories": [ { "category": "wordpress", "action": "block" } ] } } } ] }'Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark