A report from CloudFlare says that over 94% of all HTTP requests that come from across the Tor browsing network are malicious. Here is how to block this type of traffic from accessing your website. Please note you this is assuming that you are using CloudFlare.
After logging into the CloudFlare website.
Click Firewall:
Then click Create Firewall Rule:
Next Give your rule a name, select Continent in the Field form, Select Value Tor, Action Block, Click Deploy.
There you go, you have a free solution to block Tor traffic to your website.
After 24 hours check back to the Cloudflare console and you will be able to see how effective the new firewall rule is: