WordPress.org

Ready to get started?Download WordPress

Forums

iQ Block Country
A workaround for a single country (4 posts)

  1. xpil
    Member
    Posted 9 months ago #

    I have had an issue recently: iQBC was competing for priority with one of my caching plugins, resulting in frequent false positives (i.e. people from non-blocked countries were getting the "Not available in your country" error message from the cache).

    The quick solution is - of course - to deactivate either caching or iQBC but that's just hiding the problem not solving it.

    The real solution is to use .htacess file to block all IP subnets of the country we want to block. In my case it was just one country (China, spammers knocking my door every 3-4 seconds, very annoying).

    There is a website that can generate the relevant section of .htaccess for you - just copy and paste it at the very end of your blog's .htaccess file and you are done. No more issues with visitors from that country and no more problems with the caching plugin.

    The website is http://www.ip2location.com/free/visitor-blocker

    I have been using this method for a couple of days now and I am extremely happy with it. Removed iQBC plugin from my WP.

    http://wordpress.org/plugins/iq-block-country/

  2. Pascal
    Member
    Plugin Author

    Posted 9 months ago #

    That is one way to do it yes.

    However be careful as a very long .htaccess file may cause other (performance) problems as the webserver will need to parse the .htaccess file on every request for a match.

  3. xpil
    Member
    Posted 9 months ago #

    I agree and I have just experienced such performance issue. I moved the list of blocked IPs out of the .htaccess file and configured iptables instead. Huge improvement!

  4. Pascal
    Member
    Plugin Author

    Posted 9 months ago #

    Yeah IPTables will do the job. Unfortunately iptables is not available for the majority of websites as they run on shared environments.

    But I am glad you found other ways to solve your problems :-)

Reply

You must log in to post.

About this Plugin

About this Topic