The Joomla! Extensions Directory ™

CFBlockCountry Plugin

Block Country from accessing your site. No need to enter IP ranges.

cfBlockCountry (Plugin)

The plugin cfBlockCountry can be used to block IP address from certain countries. For example if you want to block access of the site from any IP in United States you can use this plugin.

Some important points:

1. It only blocks access to website and not the admin interface so that if you accidently block your own country you can reset the country list
2. We use free DB from MaxMind. As per the MaxMind this DB is 99.5% accurate.
3. There are 2 options in the plugin, if you want to use geoip database from local server, you can select the Local option after installing the plugin. But before you select local option please upload geoip folder in the plugin zip file to /libraries/ folder of joomla installation. If this operation is not performed and local option is selected this will cause error on Joomla and you may not be able to access joomla site unless plugin is disabled from DB.
4. The benefit of choosing local option is that you can buy the latest more accurate DB from and use that DB


1. Country Codes: This requires comma (,) separated list of Country codes that need to be blocked. For example US, IN, FR to block IP Address from United States, India and France.

2. Verification: External (default) or Local. External will use Server to validate the country. We use latest Free DB from MaxMind In case you want to use local Verification you will need to install the geoip DB on your server. Please do not enable Local without installing the DB. (Refer below for installing the DB)

3. Message or Redirect: In case a user from blocked country accesses the site, you can display an error message or redirect them to some other site.

4. Text Message: This is the error message that will be displayed.

5. Site: You need to set url for the site where you want to redirect the user example

Install GeoIP DB for local option.

1. Extract the geoip folder from the plugin zip.
2. Upload the folder geoip to libraries/ folder of Joomla installation
3. Get the latest GeoIP.dat. and replace the existing (blank file with same name)one in /library/geoip folder
4. Enable Local option in plugin settings.

Bug Fixed
1. When Verification is set to Local plugin was not blocking countries. This has been fixed and will be available in new releases today forward (30 June 2010). Thanks to Markus for reporting the bug.

Joomla 2.5

This plugin now supports Joomla 2.5. all the above instructions apply to the new version as well. The default download from here is for Joomla 1.5. You will need to go to to get the plugin for Joomla 2.5

Report Extension



Reviews: 3

it seems to be a very good and simple plugin.

But its not working with php 5.4.

If they solve this issue, its a great deal
Reviews: 2
It was so easy to setup.
I have a note though, I blocked my country in order to see how the site will behave, but I could not login to the admin backend.
I had to go through the phpmyadmin to remove my counrty from the table record. this should be revised again.
Reviews: 14
Very simple to install using your instructions. I used the local option, WOW what a difference on the server. Some of those hackers were hitting it fast & hard and it has been slow for weeks but after installing this and blocking the countries in question pages are loading instantly again. Thank you for making this free!
Reviews: 4
I originally tried this plugin some years ago but wasn't really sure about its usefulness. However recently my site has been really suffering from spurious sign-ups and, in another case a serious attempt at MySql insertion. Revisiting this plugin and installing it has eliminated the problem (till the bad boy start using proxies on me, I guess).

Oh and to avoid a wee panic and much blinking - ensure you use the correct version for 2.5 (as mentioned in the instructions above)!
Reviews: 2
Hi, I have been using this plugin on my 1.5 sites with great benefit. It does what it says and is hassle free. I installed this for my 2.5 site and now when I include US in the list of countries to test this plugin, the administrator page gets blocked as well. This doesn't happen on 1.5. It would be great if this could be fixed. Thanks!
Owner's reply

Thanks for the review and feedbak. We shall fix this issue in 2.5 version and let you know.


Reviews: 14
Hi, I installed this plugin and find it very usefull, wathever, I can't really juge its results, but I think it works as it said.
To developper : admin needs to feel all country codes he wants to block , I think it could be better and easier to feel only country you want to allow and block all others, something like : block country = all exept us,ca,fr ... as you can permit only to your choice without searching all country codes.
Thanks whenever ...
Owner's reply

Hi Snooky147,

Thanks for the good rating and comments. I agree with what you have suggested and we shall incorporate that functionality soon!


Reviews: 1
Product was VERY easy to install and worked the first time I tried. I did notice that MaxMind has a city list as well. Sure would be nice to have that option as well!
Owner's reply

Hi There,

Thanks for the rating and comment. We initially thought that allowing this to work at city level would probably be an overkill as not too many sites are only focused on a very limited area. However, if you could provide more details on how this would be useful, we can go ahead and implement the same.

PS: By the way we have released the Joomla 2.5 version so you may want to use that for latest joomla installs

Reviews: 2
Great as it says.

1) install plugin
2) setup redirect www
3) setup an external IP database automatically or for local just copy the GeoIP as readme says

4) tested with FoxyProxy IP adresses from various country...WORKS!


One thing: it should be defined as a Redirect IP tool as well, not just a ban IP.
Owner's reply

Hi McLaren,

Thanks for the cool rating and great comments!
I agree that we should list this under "Redirect IP tool", but somehow I could not find that category on joomla extensions.


Reviews: 1
After installing the pluging it did not work, but GREAT support from Pranjal, at it works perfectly.
Reviews: 1
I appreciate the attempt at creating a plugin for joomla using MaxMind...however it did not work for me.

Here is what I went through.... I installed the plugin. I went to configure the gives you 2 options... to check the country codes database externally or... to run the db locally. My first choice was to try to run it externally since there was absolutely no setup required (minus entering in country codes, and page message for the blocked user)... after choosing that option I refreshed my website and I was getting a website is not available error... and I dont think it was the plugin at work. Therefore I tried the local option...and I followed the instructions left in the readme file... those instructions told me to move the geoip folder to the libraries directory under my joomla site... then get the .dat file from the Maxmind site, then overwrite the blank file in the libraries/geoip folder... after doing all of that... i got the same results as when i tried to run it externally... the whole website does not work unless I disable the plugin. Wasted a lot time trying to figure this out, and still cannot get it to work properly.
Owner's reply

Hi jthompson,

I am really sorry that the plugin did not work for you. We would be willing to work on this and resolve the issue. Either post a comment here or send an email to Also we have released Joomla 2.5 version may be you would want to try that.


Reviews: 7
I would like to thank you for this tool. I have tried to develop something like this myself and must admit that your solution works better. I have a few improvements though: It should also be possible to use the professional online country service, for which I have a license code. This is even more accurate than the free database.

I would like to see some further information: Is every page request checked or only once per session, which would prove not such a good solution for those robots, which request a page again and again per session...

Best regards,
Owner's reply

Hi Kelley,

Many thanks for providing such useful suggestions on the plugin. We shall definitely implement these in near future and update you once done.


Reviews: 2
Think at the next revisions to give the possibility to the admin to exclude some IPs. Consider the case if you want to ban your proper country. Than you can't see your front face site anymore (only with proxies bla bla)
Owner's reply

Hi alink,

Thanks for the feedback and rating. I agree with your suggestion on excluding a certain IP address from the given country. We shall implement this in near future and keep you updated.


Reviews: 18
Great idea, but,...
Installed locally on my XAMPP server and it is not working (popuing up an error). also it would be nice to attach a country code list to the extension.
Owner's reply

Hi There,

Thanks for the feedback. Though you have not provided the exact errors that you encountered on local setup, but a lot of times cURL is not enabled by default and that could lead to errors displaying.

We have released a new version for Joomla 2.5, if you try the same and still get any error message please feel free to contact me ( and I will ensure that all issues are taken care of!


Reviews: 5
Our site was being attacked by servers in Sweden and China all day. Considering our website is only for people in Missouri, there was no purpose for other countries to be on our site to the tune of 48,000 hits in a day. CPU and Load Averages were off the charts and our site was out of memory and at a stand still. After installation, perfect harmony, total bliss. Great job!
Reviews: 2
This is a brilliant plugin - essential in fact.

All of us who are running forums as part of our Joomla! sites or have enabled user comments, especially when our user base is relatively local, want to restrict who can access the site in order to reduce spam/hacking attempts. That's what this does, on a country basis using a geo-ip address database.

There are even two modes of operation - external or local. The local option means that you can install the database (free, monthly download from and therefore not be dependent on maxmind's online service being available.

It's early days (I only just installed and tested it) but I would say this is a winner.
Reviews: 1
The companies website hasn't been online long and it seems they are based in India. But my loathing of spammers trumped my caution of new products without reviews.

I'm not a joomla expert but this product seems to work ok, and like the review above I tested it on my own country which it blocked.

I've no doubt some spammers will figure out a way around it within a week using proxy servers or something but at least for now it works great on my site. ....thanks.
Reviews: 1
I needed to block a country because of spamming issues.

This plugin was easy to install even for a novice like myself.

Configuring the plugin is simple, because you can just add the two letter country codes instead of IP ranges.

It works perfectly (I tested it for my own country) and I have not noticed any incompatibility issues.

The developer responded quickly to my inquiry.

In the future it would be nice to be able to block back-end admin interface also and see somekind of statistics of blocked attempts.

Excellent work!