Title: IP Blocking
Last modified: November 11, 2017

---

# IP Blocking

 *  Resolved Anonymous User 14978628
 * (@anonymized-14978628)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/ip-blocking-2/)
 * Hi Jeff,
 * If i want to transfer the blocked ips collected by Blackhole to my htaccess, 
   could you tell me is it best to enter those ips before the Begin WordPress code
   in the htaccess?
 * Basically, i’m wondering if doing so would block those ips before WordPress is
   actually loaded, or doesn’t it work this way and entering the ips to block after
   the WordPress code would have the same effect?
 * Thanks

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

 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/ip-blocking-2/#post-9673963)
 * Yes that is correct, in general controlling traffic at the server level (via 
   config or .htaccess) is better for performance. As for the location of the rules
   in .htaccess, it’s best to include them before any WordPress-related directives.
 *  Thread Starter Anonymous User 14978628
 * (@anonymized-14978628)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/ip-blocking-2/#post-9674000)
 * > As for the location of the rules in .htaccess, it’s best to include them before
   > any WordPress-related directives
 * Is that a general rule for anything i put in the htaccess, or would that only
   apply to things such as ip blocking? Also, just to confirm, you’re saying that
   putting stuff in before the wordpress-related directives will cause it to take
   effect before wordpress is loaded?
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/ip-blocking-2/#post-9674012)
 * It is the case for this particular question, but not in general because it depends
   on the directives used for blocking, as well as any other directives in the file.
   So in this specific case, I recommend placing whichever blocking rules before
   any WordPress rules.
 *  Thread Starter Anonymous User 14978628
 * (@anonymized-14978628)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/ip-blocking-2/#post-9674015)
 * Thanks Jeff 🙂

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

The topic ‘IP Blocking’ is closed to new replies.

 * ![](https://ps.w.org/blackhole-bad-bots/assets/icon-256x256.png?rev=1471215)
 * [Blackhole for Bad Bots](https://wordpress.org/plugins/blackhole-bad-bots/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/blackhole-bad-bots/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/blackhole-bad-bots/)
 * [Active Topics](https://wordpress.org/support/plugin/blackhole-bad-bots/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/blackhole-bad-bots/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/blackhole-bad-bots/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: Anonymous User 14978628
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/ip-blocking-2/#post-9674015)
 * Status: resolved