Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author tokkonopapa

    (@tokkonopapa)

    Hi verityr,

    My recommendation is applying Basic Authentication as Codex mentioned.

    Or if you can restrict the IPs to your ISP, put them into your .htaccess.

    Or if you strongly want to use this plugin, you can put the following code into your functions.php like this doc shows.

    function my_extra_ips_hook( $extra_ips, $hook ) {
        $whitelist = '123.456.789.1/18'; // your ISP IPs by CIDR
    
        if ( in_array( $hook, array( 'xmlrpc', 'login' ) ) ) {
            $extra_ips['white_list'] .= ( $extra_ips['white_list'] ? ',' : '' ) . $whitelist;
        }
    
        return $extra_ips;
    }
    add_filter( 'ip-geo-block-extra-ips', 'my_extra_ips_hook', 10, 2 );

    I don’t recomment the last method because it’s quite inefficient.

    Good luck!

    Plugin Author tokkonopapa

    (@tokkonopapa)

    Oh, I made a mistake. The last method I post doesn’t work unless you set the country code XX as a white list for example. The code XX will block any requests including from you. And this also affects other targets. So please forget the last method.

    This plugin can limit the number of login attempts. After reaching at the limit, the attacks will be blocked at the very beginning of the WordPress process. This can minimize the load of your server.

    Otherwise, the first method is the best because it’s done right before the WordPress is processed.

    Thread Starter verityr

    (@verityr)

    I apologize, I was never notified through email that you had replied.

    I will try #2, the htaccess file. Thank you!

    Jennifer

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘blocking my own country’ is closed to new replies.