Block Tor traffic
Last updated Oct 9, 2026
Cloudflare identifies requests coming from Tor exit nodes with the continent code T1. If you do not want Tor traffic on your zone, this example custom rule blocks requests from the Tor network using the ip.src.continent field.
- When incoming requests match:
If you are using the expression editor:
(ip.src.continent eq "T1")
- Then take action: Block
If you prefer not to block Tor traffic outright, use the Managed Challenge action instead.
Note
If you block or challenge Tor traffic, disable Onion Routing on your zone. Onion Routing improves the experience of visitors using the Tor Browser, which contradicts blocking Tor traffic.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/waf/custom-rules/use-cases/block-tor-traffic/#page","headline":"Block Tor traffic","description":"Block or challenge traffic from the Tor network.","url":"https://developers.cloudflare.com/waf/custom-rules/use-cases/block-tor-traffic/","inLanguage":"en","image":"https://developers.cloudflare.com/waf/custom-rules/use-cases/block-tor-traffic/og.png?v=2fead4a3cefd896c","dateModified":"2026-10-09","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: Block traffic from specific countries with a custom rule. title: Block traffic from specific countries image: https://developers.cloudflare.com/waf/custom-rules/use-cases/block-traffic-from-specific-countries/og.png?v=46cfeba865d34afb
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/waf/llms.txt
Use this file to discover all available pages before exploring further.
Docs