Title: Banning anonymous bot
Last modified: August 22, 2016

---

# Banning anonymous bot

 *  Resolved [ditad](https://wordpress.org/support/users/ditad/)
 * (@ditad)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/banning-anonymous-bot/)
 * An anonymous bot is crawling my site excessively. It has no user-agent, is using
   a private ip address (same as WordPress spider), and has no referer. The only
   identifier is its hostname. How to ban this bot? Blocking by IP is no option 
   and Wordfence does not allow blocking based on hostname (for a good reason).
 * [https://wordpress.org/plugins/wordfence/](https://wordpress.org/plugins/wordfence/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [ditad](https://wordpress.org/support/users/ditad/)
 * (@ditad)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/banning-anonymous-bot/#post-5881569)
 * I found a solution for using .htaccess to block empty user_agents. Can I do this
   without causing other problems?
 *  [WFSupport](https://wordpress.org/support/users/wfsupport/)
 * (@wfsupport)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/banning-anonymous-bot/#post-5881587)
 * Can you show the code you used?
 * tim
 *  Thread Starter [ditad](https://wordpress.org/support/users/ditad/)
 * (@ditad)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/banning-anonymous-bot/#post-5881594)
 * RewriteEngine on
    # BEGIN block access for empty user agents – 403 error RewriteCond%{
   HTTP_USER_AGENT} ^$ RewriteRule ^(.*)$ – [F,L] # END block access for empty user
   agents
 * I found it here: [http://ac2a.com/how-to-block-access-empty-blank-user-agent/](http://ac2a.com/how-to-block-access-empty-blank-user-agent/)
 *  [WFSupport](https://wordpress.org/support/users/wfsupport/)
 * (@wfsupport)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/banning-anonymous-bot/#post-5881609)
 * I think we already have this feature on the bottom of our options page (Other
   Options section)
    Block IP’s who send POST requests with blank User-Agent and
   Referer
 * tim
 *  Thread Starter [ditad](https://wordpress.org/support/users/ditad/)
 * (@ditad)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/banning-anonymous-bot/#post-5881665)
 * I am already using that option, but the bot still got through. I added in the
   rewrite rule to my htaccess file and the hits disappeared!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Banning anonymous bot’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

## Tags

 * [ban](https://wordpress.org/support/topic-tag/ban/)
 * [blocking](https://wordpress.org/support/topic-tag/blocking/)
 * [bot](https://wordpress.org/support/topic-tag/bot/)
 * [crawling](https://wordpress.org/support/topic-tag/crawling/)

 * 5 replies
 * 2 participants
 * Last reply from: [ditad](https://wordpress.org/support/users/ditad/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/banning-anonymous-bot/#post-5881665)
 * Status: resolved