Title: Error using WP_FAIL2BAN_BLOCKED_USERS
Last modified: August 22, 2016

---

# Error using WP_FAIL2BAN_BLOCKED_USERS

 *  Resolved [n0dyjeff](https://wordpress.org/support/users/n0dyjeff/)
 * (@n0dyjeff)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/error-using-wp_fail2ban_blocked_users/)
 * With the latest release of wp-fail2ban (2.2.0), I found I wasn’t able to use 
   WP_FAIL2BAN_BLOCKED_USERS with a regex for a specific username. E.g.
    `define('
   WP_FAIL2BAN_BLOCKED_USERS','^admin$');` didn’t work.
 * Looking into the code, I see that the problem is in the test for the definition
   of WP_FAIL2BAN_BLOCKED_USERS. The original code:
 * `if (defined('WP_FAIL2BAN_BLOCKED_USERS') && true === WP_FAIL2BAN_BLOCKED_USERS)`
 * wants to see if the string ‘WP_FAIL2BAN_BLOCKED_USERS’ is identical to the Boolean
   true (which it is not).
 * The following code meets the intent (allows WP_FAIL2BAN_BLOCKED_USERS to be turned
   off by defining it false), and also allows the regex to work:
 * `if (defined('WP_FAIL2BAN_BLOCKED_USERS') && false !== WP_FAIL2BAN_BLOCKED_USERS)`
 * Or perhaps I’m missing something?
 * [https://wordpress.org/plugins/wp-fail2ban/](https://wordpress.org/plugins/wp-fail2ban/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [invisnet](https://wordpress.org/support/users/invisnet/)
 * (@invisnet)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/error-using-wp_fail2ban_blocked_users/#post-5175828)
 * No, you’re quite correct – it was a stupid mistake on my part.
 * Should be fixed in 2.2.1, just released.

Viewing 1 replies (of 1 total)

The topic ‘Error using WP_FAIL2BAN_BLOCKED_USERS’ is closed to new replies.

 * ![](https://ps.w.org/wp-fail2ban/assets/icon-256x256.png?rev=2814701)
 * [WP fail2ban - Advanced Security](https://wordpress.org/plugins/wp-fail2ban/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-fail2ban/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-fail2ban/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-fail2ban/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-fail2ban/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-fail2ban/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [invisnet](https://wordpress.org/support/users/invisnet/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/error-using-wp_fail2ban_blocked_users/#post-5175828)
 * Status: resolved