Title: Does WF Block before WP Init
Last modified: January 30, 2023

---

# Does WF Block before WP Init

 *  Resolved [fizirizi](https://wordpress.org/support/users/fizirizi/)
 * (@fizirizi)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/does-wf-block-before-wp-init/)
 * I was just wondering when the blocking happens.
 * I created a plugin for ab testing, and it runs as soon as page loads i want to
   remove bots, so that my test does not run and register them as user. So i need
   to know does WF block before wp_init or is there a GLOBAL variable like USER_BOT(
   true or false).
    -  This topic was modified 3 years, 4 months ago by [fizirizi](https://wordpress.org/support/users/fizirizi/).

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

 *  Plugin Support [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * (@wfpeter)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/does-wf-block-before-wp-init/#post-16422562)
 * Hi [@fizirizi](https://wordpress.org/support/users/fizirizi/), thanks for your
   question.
 * If the WAF is optimized, blocks occur before WordPress runs and therefore no 
   information is passed on about whether we suspect that user to be a bot or human.
 * Regarding the bot/human question in general, it’s becoming ever harder to guarantee
   a visit is from one or the other although we do try in Live Traffic based on 
   their behavior before a request was made. The intent is now more important to
   the Wordfence plugin when making a decision on blocking.
 * Thanks,
   Peter.
 *  Thread Starter [fizirizi](https://wordpress.org/support/users/fizirizi/)
 * (@fizirizi)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/does-wf-block-before-wp-init/#post-16422706)
 * Thanks for the fast reply.
 * Just to make sure the following function wont run?
 * add_action(‘wp’, ‘some_function’);
 *  Plugin Support [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * (@wfpeter)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/does-wf-block-before-wp-init/#post-16491869)
 * `add_action()` can’t be run based on a Wordfence function that currently believes
   the user to be bot or human, but you can run the function itself after `init()`
   as part of your plugin as others do.
 * Peter.

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

The topic ‘Does WF Block before WP Init’ 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

 * [bots](https://wordpress.org/support/topic-tag/bots/)

 * 3 replies
 * 2 participants
 * Last reply from: [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/does-wf-block-before-wp-init/#post-16491869)
 * Status: resolved