Option to release blocked IPs by Defender

Defender Blocked one of my IP, how do I release the IP? During the chat session I was suggested to whitelist it, but I should see the IP that has been locked out. And I should also be able to release it. I don't want to whitelist any IP.
Would it be possible to add a new feature to Defender to allow admins to release IPs blocked by Defender without needing to whitelist them?

  • Ash

    Hello Gibson

    I am afraid, this is not an option at the moment. But I do think this would be a nice feature, so I have marked this as a feature request for now, so other member can share their thoughts on this as well.

    As a workaround, you can use the following code:

    add_action( 'init', function() {
    
        $ips = array('145:467:24:2', '145:467:27:2' ); // IPs you want to release;
    
        foreach ($ips as $ip) {
    
            $model = IP_Model::findOne( array(
                'ip' => $ip
            ));
    
            if ( $model ) {
                $model->delete();
            }
        }
    });

    You can use this code in your child theme's functions.php if the theme is not changed. Otherwise mu-plugin is the best option. To create a mu-plugin, go to wp-content/mu-plugins folder. If there is no mu-plugins folder then, create one. Now, inside the mu-plugins folder create file with name anything.php (make sure file extension is .php). Now start with a <?php tag and then put the above code.

    Then refresh the site 3-4 times, check if the IP is released, then you can remove the code.

    Have a nice day!

    Cheers,
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.