Country Filter WordPress plugin

Description

Country Filter plugins allows you to control the visibility of WordPress elements depending on the users country of origin. You can hide or show certain elements of a page or some sections of a post from users browsing from a particular country. For example you could have a ‘donate’ button that displays only if the user is browsing from France, or display one ‘Buy Now’ button for a particular country and another for other countries. Maybe you want to display a video only for users in the US or Australia.

Developers and designers could use the plugin to load different stylesheets based on the users country. Services like hulu.com uses techniques such as this to constrain viewership to a particular country.


Supported WordPress versions

WordPress 2.5 and above. Tested upto version 3.9

Purchase Plugin

Buy Now

The download link will be emailed to you immediately on payment. Also, any future updates will be free for all buyers and will be emailed to you as and when available.

Installing the Country Filter plugin

Installation instructions are provided in the download.

>> Usage

Country Filter plugin works mainly in two ways – via a short code, and by directly adding some PHP code.

Short codes

The easiest method is to use the short-codes. This will allow you to show/hide content in posts by using the ‘country-filter‘ shortcode. For example if you want to show a certain part of your posts/page only to users who are browsing from ‘United States’ or from ‘India’ than you can use the following code. The code used are the ISO 3166-1 alpha-2 2 digit codes.

[country-filter code="us, in"  display="1"] 
Hello World! 
[/country-filter]

Setting the above shortcode in a post/page will display the string ‘Hello World!’ only for the users in US and India. People in other countries will not be able to see the string. On the other hand, setting the display attribute to ’0′ will hide the content for users in US and India but will display the string to people from other countries as given in the following code. Note that the content between shortcodes can be anything you like.

[country-filter code="us, in"  display="0"] 
Hello World! 
[/country-filter]

Example:
Suppose you want to display a ‘Buy Now’ button in a post, maybe you are selling a product and want to add different prices – one for the users in the US and another for all other countries. You can then use the short codes as below. So now, if a user is browsing from the US the first shortcode rule applies and the text ‘Buy Now for only $45′ is displayed, on the other hand, for users from other countries the second rule applies and the text ‘Buy Now for only $32′ is displayed. As said earlier the second shortcode hides the text for the users form the US but displays for all others.

[country-filter code="us"  display="1"] 
Buy Now for only $45
[/country-filter]
 
[country-filter code="us"  display="0"] 
Buy Now for only $32
[/country-filter]

The short code takes two attributes, both of which are mandatory.

code : A comma separated list of 2 digit ISO 3166-1 alpha-2 country codes.
display : Set to ’1′ if you want to display or ’0′ if you want to hide the content. If set to ’0′ the content will be hidden for the given countries but displayed for others.

Nesting Short codes

You can nest your other plugin short codes in between the ‘country-filter’ short code to control the visibility of the other plugin data. For example, the following code nests the WordPress ‘gallery’ shortcode, which will now only be displayed if the user is browsing from the US or India.

[country-filter code="us, in"  display="1"] 
[gallery]
[/country-filter]

Maybe you have a form plugin which provides a ‘[form]‘ shortcode and you want to display the form only for users NOT from the US. The following gives an example for that particular scenario.

[country-filter code="us"  display="0"] 
[form]
[/country-filter]

Another use case frequently needed by users – to show / hide PayPal buttons for different countries. For example the following will show the PayPal ‘Buy Now’ button for US users only.:

[country-filter code="us" display="1"]
 
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="dummy-email@yahoo.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Design e-book">
<input type="hidden" name="amount" value="12.00">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
 
[/country-filter]

Filtering other content

You can also filter content other than posts with the isCountryInFilter function. Note that for this you will need to make changes to sections of the theme files. For example if you would like to display some content – like a button, a widget or some section of a web page, that should only be visible for people browsing from US, UK or Australia than you can do it as follows.

.
.
<?php if (function_exists('isCountryInFilter')) { ?>
<?php if(isCountryInFilter(array("us", "gb", "au"))) { ?> 
 
// The content here is displayed only for users 
// browsing from US, UK or Australia.
 
<?php } } ?>
.
.

You can also add a else section.

.
.
<?php if (function_exists('isCountryInFilter')) { ?>
<?php if(isCountryInFilter(array("us", "gb", "au"))) { ?> 
 
// The content here is displayed only for users 
// browsing from US, UK or Australia.
 
<?php } else { ?>
 
// People from other countries will see the content
// given here but not the above.
 
<?php } } ?>
.
.

This is a powerful way to control content on your WordPress site. You can control almost any type of content with this method. You can hide/display entire sections of WordPress depending on the users country.

Note that the isCountryInFilter function takes an array of country codes and returns true if the country code of the user browsing the site is in the array. Note that this function is especially useful for developers, as they can include custom code and other files depending on the users country.

Another function added in version 1.5 is showCountryContentInPage. This function is just like the short code version above, but can be used to manipulate content other than posts. This takes an extra ‘display’ parameter after the countries array. If set to ’1′ than the content will be only displayed for the given countries. If set to ’0′ than the content will be hidden for the given countries but displayed for others.

<?php if (function_exists('showCountryContentInPage')) { ?>
<?php if(showCountryContentInPage(array("us", "gb", "au"), 1)) { ?> 
 
// The content here is displayed only for users
// browsing from US, UK or Australia.
 
<?php } } ?>

Take another example – we want to display different banners depending on if the user is from the US, the Netherlands and a third banner for all other users.

<?php if (function_exists('showCountryContentInPage')) { ?>
<?php if(showCountryContentInPage(array("us"),1)) { ?> 
 
// The banner here is displayed only for users browsing from US.
 
<?php } elseif(showCountryContentInPage(array("nl"),1))  { ?>
 
// The banner here is displayed only for users browsing from Netherlands.
 
<?php } else  { ?>
 
// People from other countries will see the content
// given here but not the US, or Netherlands (nl).
 
<?php } } ?>

Another example – you want to display a certain banner in the sidebar (or anywhere else) which will be visible to all the users from all countries except the ‘US’; in short, we want to hide the banner for users from the ‘US’ only.

<?php if (function_exists('showCountryContentInPage')) { ?>
<?php if(showCountryContentInPage(array("us"),0)) { ?> 
   <img src="images/some_banner.jpg" />
<?php } } ?>

Dashboard

The plugin dashboard also displays the total number of times any content has been filtered by geographic areas. Note that data logging is disabled by default so you will need to enable it from the plugins admin section to be able to see the data on the map.

You can also export the generated data as a CSV file, which you can further analyze in a spreadsheet.

Troubleshooting

Plugin fails to activate
If the plugin fails to activate and displays and error, check the table names in the database, they are case sensitive. They should be ‘ip2nation’ and ‘ip2nationCountries’ if you are using the ip2nation Version of the plugin. This will work on Windows but will fail on Linux systems as the files there are case sensitive.

Plugin gives inaccurate results
This can happen if your PC is behind a firewall, proxy or a VPN. This programs tend to hide your original IP address, which can result in incorrect results. This is something the plugin, or for that matter any other plugin, cannot do anything about.

FAQ’s

Will the plugin work with mobile devices and sites.
As long as your mobile device provides a correct ip address the plugin will work without any problem. Go to a site such as http://www.whatismyip.org/ or http://www.whatismyip.com/ to check the ip address of your mobile.

Some of the sites using the plugin

Purchase Plugin

Buy Now

Changelog:

# Version 1.01
* FIXED: Problem between spaces in country codes
# Version 1.1
* ADDED: Support for nested shortcodes
# Version 1.5
* ADDED: New function and changed some logic.
Thanks to Matt of NuFlux Media Inc for providing excellent feedback.
# Version 2.0
* ADDED: Users visualization by country.

131 Responses

1

WordPress Plugin Releases for 07/08 | Weblog Tools Collection

July 7th, 2009 at 1:08 pm

[...] Country Filter [...]

2

EasySeo | WordPress Plugin Releases for 07/08 | SEO2Blog

July 7th, 2009 at 5:41 pm

[...] Country Filter [...]

3

New Wordpress Plugins Release 07/08/2009

July 7th, 2009 at 6:08 pm

[...] Country Filter [...]

4

WordPress Plugin Releases for 07/08 | The Cliffmaster

July 8th, 2009 at 6:39 am

[...] Country Filter [...]

5

Tim Marchant

July 12th, 2009 at 2:14 am

Thanks for this. It would be worth adding a couple of lines above telling people how to do:

} else {

:-)

6

Matt

July 17th, 2009 at 11:55 am

Hey Sameer,

Thanks for the plugin! It’s exactly what I have been looking for.

But unfortunately, it’s not working for me. I have the plugin activated, and the database installed (I see them in phpmyadmin).

I tried the following code,

[country-filter code="us, in, uk" display="1"]
Hello World!
[/country-filter]

and

[country-filter code="us, in, uk" display="0"]
Hello World!
[/country-filter]

But I see nothing at all in my post. Any ideas?

Many thanks,
Matt

7

Matt

July 17th, 2009 at 12:01 pm

Damn, the php code in my sidebar didn’t work either :/

I’m quite sure I set everything up okay.

Thanks for your help, it should be a great plugin!

8

WordPress Plugin Releases for 07/08 « Web And Graphics Design Tutorials

July 28th, 2009 at 8:56 am

[...] Country Filter [...]

9

New Useful WordPress Tricks & Hacks | ART HACKER

August 13th, 2009 at 10:48 pm

[...] Filter content by country [...]

10

30+ Tips&Plugin per Wordpress | GeekTwice

August 20th, 2009 at 1:05 am

[...] Filter Content By Country [...]

11

Unlimited New Useful Wordpress Tips,Tricks & Hacks - Themeflash : One Stop For All Your Web Resources

August 23rd, 2009 at 11:41 pm

[...] Filter content by country [...]

12

30+ New Useful WordPress Tricks & Hacks | MEN blog . net

September 4th, 2009 at 2:26 am

[...] Filter content by country [...]

13

Sergio Hernandez

September 5th, 2009 at 7:42 am

Thanks, Great plugin…! The best..

14

30+ New Useful WordPress Tricks & Hacks | My Tech way

September 14th, 2009 at 6:51 am

[...] Filter content by country [...]

15

John Thornley

October 1st, 2009 at 4:38 am

If you are from the UK (like me) then just be aware that the example is incorrect. You need to use “gb” not “uk” as is stated in the example.

Just trying this plugin out and it wasn’t working… when I investigated then this was the problem.

Apart from that, it seems like a brilliant plugin. Thank you very much for all your hard work in making it.

Cheers

John
http://www.friendsatrest.com

16

sakthi Ganesh

October 2nd, 2009 at 9:56 am

I really appreciate for these kind of exceptional plug-in . Hats off for the good work . Looking more in future

17

George Rakkos

October 13th, 2009 at 4:53 am

I second this:

“Thanks for this. It would be worth adding a couple of lines above telling people how to do:
} else {“

18

George Rakkos

October 13th, 2009 at 5:01 am

small problem i updated to 1.5 and it does not work as before

19

Leannekera

November 12th, 2009 at 7:47 am

This plugin saved my life, I really cant thank you enough!

We originally quoted for a site to be duplicated 7 times for 7 different country prices. Now all we need to do is 1 wordpress build and utilize this script to enable the site to hide/show the different prices based on ip.

I LOVE YOU FOR THIS SCRIPT!

20

Sakthi Ganesh

November 23rd, 2009 at 7:52 am

I have found some issues with my setup ( may be with this plugin)

I have blacklisted the various offensive words using the filter textbox . one of the word is “ass” .I have included the conclusion that ,the plugin may find and replace the ” Three letter world” combination of “a”,”S”,”S” that forms the word “ass”.

But what it happened is
It blocked the words that start with particular three letter word .For example it blocked and replaced theword

“Assets” with ” ***ets ” which one i didn’t expected

For example the line is become

To protect the digital ***ets( which one is gone meaningless )

Is that any solution for that ?

sameer

November 23rd, 2009 at 10:12 pm

The plugin doesn’t work as a language filter, but as a content filter for country codes.

22

Timo

November 24th, 2009 at 12:13 am

It seems that this plugin doesn’t work inside a widget :( I want to create a text box widget and insert country filter code there (to show some banners to specific country) but it just shows the country filter code there. Anyone else has the same issue?

23

Sakthi Ganesh

November 24th, 2009 at 1:12 am

Hi:

I am very sorry for mis posted comment numbered 20.

The comment numbered 20 is mis posted and these bug report should be made to the plugin

http://wordpress.org/extend/plugins/wp-content-filter/

Sammer your plugin is a exceptional plugin i will write a review on my blog and i will let you know!

I am sorry sameer and the fellow readers for this .
Thanks

24

ShocWave

December 1st, 2009 at 1:48 pm

You know what would be really cool? If it was possible to show or hide an entire post, not just its contents.

Maybe it can be done through tags or catagories?

25

Simone Carletti

December 22nd, 2009 at 10:05 pm

Hello,
there’s a small bug when the user is connecting through a proxy.

You should change

$ip_address = $_SERVER["HTTP_X_FORWARDED_FOR"])));

to

$ip_address = trim(end(split(“,”, $_SERVER["HTTP_X_FORWARDED_FOR"])));

Proxies usually appends the full ip chain in the header, values are separated by commas. The last element is the public IP.
Example

78.78.78.78 # public IP
192.168.1.1, 78.78.78.78 # proxy + public IP
192.168.1.140, 192.168.1.1, 78.78.78.78 # lan + proxy + public IP

26

James

December 28th, 2009 at 7:55 pm

Huge Thanks!

If I am able to implement this the way that I am planning (geo-specific advertising) it should bring me some extra income and if it does then I will definitely float some of that your way!

By the way, the final example above is using the wrong function. It should be the “showCountryContentInPage” in the example, correct?

sameer

December 28th, 2009 at 10:26 pm

Thanks for pointing out the error James.

28

James

December 29th, 2009 at 10:33 pm

I am very curious about Simone Carletti’s suggestion above regarding some additional parsing to handle proxied IP addresses.

Have you tested this Simone?

Sameer, what do you think?

I can tell you that I tried using my company’s VPN in a different country and the filter responded to the country of my VPN connection (not my true location), just as most web site’s do. Would Simone’s suggestion allow this code to see my originating IP address when using a VPN connection?

sameer

December 29th, 2009 at 11:52 pm

Hello James! I’ve not yet tested the proxy modification at my end, will do in a couple of days; meanwhile you can try it at your end and let me know the results.

30

plienine

January 5th, 2010 at 12:54 pm

Hello,
Is it possible to use this plugin in e107 CMS ???

Great plugin and I want to integrate it in e107 system…

Thank You for any kind of help….

sameer

January 5th, 2010 at 9:00 pm

You cannot use the plugin in e107.

32

Veerendra

March 12th, 2010 at 10:21 am

Hi sameer

great plugin to filter content. I was searching this kind of filtering plugin for doing some css tricks in my website.So I can add some custom css elements or change look of some divs based on visitors country. any idea to do this ?
btw
I am a designer and frontend developer for static website to cms. I also provide design services. I live in pune. Someday we can meet up for coffee.

bhetu ya ekda ! :)

sameer

March 12th, 2010 at 10:38 pm

You can try this in your templates header.php :

http://pastie.org/867569

34

Alex

April 8th, 2010 at 1:34 am

Sameer,

Great plugin! I’ve been searching for something like this. I want to test this out with different ips via proxies. Did you get a chance to make modifications to the plugin to accommodate proxies as suggested in above post?

sameer

April 8th, 2010 at 8:11 pm

Alex!

I’ve not yet accommodated for proxies yet!

36

Alex

April 8th, 2010 at 10:17 pm

Thanks Sameer.

Is there any way to test the dynamic content that shows up based on country? I’m sure the plugin works great, but how would I test the country-specific message or in my case a flash file without actually seeing it?

Can anyone else comment on how they were able to test their country-specific content?

sameer

April 8th, 2010 at 11:14 pm

Alex!

You need to run your site through some proxy servers. Try this one. but with caution:

http://rosinstrument.com/cgi-proxy.htm

It lets you select the Country where the proxy is located. This way you can check if your data is correctly showing up for that particular country. Also check this link addressing your type of query:

http://www.ehow.com/how_5458081_view-streaming-online-television-proxy-server.html

38

John

May 7th, 2010 at 12:51 pm

Hi Sameer,

Thanks for creating this plugin, it should be really useful for creating targeted advertising content.

I am experiencing a slight inconsistency where my content, which is targeted at the UK, appears on my home machine but not on my work machine. I’ve checked both IP addresses here: http://whatismyipaddress.com/ip-lookup and they are both geo-located as uk. Do you have any ideas of why the content does not appear?

sameer

May 9th, 2010 at 9:55 pm

Check if the ip is behind a firewall.

40

John

May 10th, 2010 at 1:06 am

Hi Sameer,

Seems to be working ok now. Must have been a problem at my end.

All the best,

John

41

Simo

June 19th, 2010 at 5:39 am

Hi Samir,

great plugin, thank you. It worked perfect for me until today (when I installed WP 3.0).

The thing that I want to appear only for some countries is a table built with Wp-Table Reloaded plugin. When I installed WP 3.0 the table stopped appearing at all for any country.
Can you give me a clue what to do.

Thanks.

sameer

June 19th, 2010 at 6:51 am

The plugin requires the ip2nation database, if your WordPress installation is new check if the database is present.

table 1 : ip2nation
table 2 : ip2nationcountries

43

Simo

June 19th, 2010 at 8:44 am

Hi Sameer,

please disregard my previous comment. I tested further the problem is only with Mozilla browser. I guess that there is something wrong at my end.

Thanks again for the great plugin.

44

Italo

August 25th, 2011 at 5:48 am

Hi Sameer

I need filter content by country, and this plugin is perfect. But I need add a button o category filter, for make more simple use… I can make this?
Thanks

45

Italo

August 25th, 2011 at 9:51 am

My friend: this plugin hide part of post, but I need hide or show entire posts…

sameer

August 25th, 2011 at 8:18 pm

Italo, the plugin currently does not support hiding entire posts and at present have no plans on doing the same. But when I update the plugin I’ll surely let you know.
Thanks!

47

gaYan

September 6th, 2011 at 3:34 am

What about “else”
It would be better if we can use the tag ‘else”

sameer

September 6th, 2011 at 4:57 am

Of course you are free to use the ‘else’ keyword when the ‘if’ condition is not satisfied.

49

coman

September 8th, 2011 at 3:21 am

Got this error:

The plugin requires the ‘ip2nation’ and ‘ip2nationcountries’ database to be installed.
You can download the same from http://www.ip2nation.com

But i imported the tables in my database. It seems like the plugin can’t find them.

Is there a fix for this?

THanks!

50

gaYan

September 9th, 2011 at 8:50 pm

I have already installed Country Filter Free version and it seems not working now.

sameer

September 9th, 2011 at 10:44 pm

The free version has been removed. The files posted at wordpress repository are blank, as it does not allow deletion of existing files.

52

Paul

September 14th, 2011 at 4:53 am

Just so I have the understanding of GPL licensing correct.

I am running 1.5.0 of the plugin as downloaded from WordPress.org

Is this permitted? If I understand GPL License agreements, there no reason I shouldn’t be allowed to use it with all rights reserved?

sameer

September 14th, 2011 at 5:12 am

yes, you can use it.

54

Dee

October 4th, 2011 at 1:15 am

Thinking of buying this plugin.

Will it work for mobile sites where I want to show different things depending for different countries?

sameer

October 4th, 2011 at 6:57 am

Yes it works with mobile devices. As long as your mobile provides a correct ip address, the plugin will work correctly.

56

Dee

October 4th, 2011 at 2:39 pm

Hi again,

Just purchased your plugin. Installed successfully but when I come to activate, I get this error message “The plugin does not have a valid header.”.

Help.

I have also downloaded the ip2nation files mentioned above. No idea where to store it, so I just kept the ip2nation zip file in the same folder as the Country-Filter zip file

57

Dee

October 4th, 2011 at 2:49 pm

Please ignore my last question. I know what I’ve done wrong.

58

Erik

November 6th, 2011 at 2:00 pm

Is there a list of country codes to use with this plugin? Could not find them at ip2nation.

Also wondering how to install the ip2nation files before ordering .. thanks

59

Candie

November 15th, 2011 at 8:15 am

Hi, I’m using Ad Injection wordpress plugin and saw that the author recommended your plugin if I we want to filter ads.

I’d like to buy your plugin but I’m not sure if this will work with WP Super Cache as well. Will I still have dynamic ad contents and at the same time filter them by your plugin?

Looking forward to your response! Thanks!

sameer

November 15th, 2011 at 9:25 am

The plugin currently does not support super cache.

61

Donald Laurel

December 22nd, 2011 at 7:19 am

Is their a way to show/hide the website from specific country? If there is, what is the code and where to put using wordpress version 3.2.1.

all I can see here is show/hide some elements in pages and posts.

Hoping for your quickest reply.

Thank you

sameer

December 22nd, 2011 at 10:15 am

You cannot use the plugin to hide whole sites. There is another plugin, ‘Country Redirect’ that allows you to redirect particular pages or the home page to other pages or urls.

63

Donald Laurel

December 22nd, 2011 at 11:03 pm

Hi Sameer,

I see. Thank you for the quick responds.

Donald

64

Youssef

December 23rd, 2011 at 10:27 am

Works great with WordPress 3.3 ! Thanks a lot!

65

Carrie

December 23rd, 2011 at 12:23 pm

Not sure what’s wrong, but I’ve set different ad for UK readers and US readers, but somehow, the plugin keeps displaying the US ads even though I’ve used UK proxy to view my web. I’m using maxmind version.

Please help Sameer

sameer

December 23rd, 2011 at 8:19 pm

Hello Carrie!

There are three reasons.

1. Check that no cache plugin like ‘wp-super cache’ is installed.

2. Go to ‘http://www.whatismyip.com/’ and get the ip of your proxy server. Then go to ‘http://www.maxmind.com/’ and at the left bottom corner on the page enter the ip address. See what location it is returning.

3. Update your ‘GeoIP.dat’ file in the plugin directory with the latest version of the file from:

http://geolite.maxmind.com/download/geoip/
database/GeoLiteCountry/GeoIP.dat.gz

Tell me how it goes.

67

Youssef

January 4th, 2012 at 2:26 am

Okay so i’m using GeoIP Lite and getting some complaints that the content doesn’t show.. everything works fine but some IP adresses are obviously not in the GeoIP database.. i was wondering if ip2nation is maybe better then GeoIP ?

Somebody who tried both and know what the best one is?

Thanks

sameer

January 4th, 2012 at 2:36 am

Hello Youssef.

Did you update the GeoIP lite database from their website :
http://geolite.maxmind.com/download/geoip/
database/GeoLiteCountry/GeoIP.dat.gz

Also if some ips are behind a firewall or a proxy, then they will not work correctly. Their is no solution for that.

69

jj

February 9th, 2012 at 11:40 am

Hi
Have you updated this plugin to work with a cache plugin as site speed seems more important in 2012
Thanks
JJ

sameer

February 9th, 2012 at 9:40 pm

Hi!
I’ve not yet found a reliable solution for that. To understand the reason you need to know how most WordPress cache plugins works:

Whenever a query is made to a post/page, a cache plugin process the php page and saves the snapshot as a static HTML file. So the next time whenever a request is made to the same page, the cache system returns the static page rather then executing the complete WordPress page. This is the reason for the site speedup, as it bypasses all the other plugin or shortcode processing.

The plugins like ‘country-filter’ are dynamic in nature, depending on the IP address of the client to deliver dynamic content. Integrating this with a cache plugin means that one way or the other the cache plugin will have to execute a plugin code to get the dynamic data, rather than the cached static page, which in itself defeats the basic idea of a cache.

71

jj

February 10th, 2012 at 1:51 am

Hi
Thanks for your detailed answer re cache

JJ

72

Giuseppe

March 16th, 2012 at 7:18 am

Hi,
Could this plugin detect the country of the visitor and then dispays ads depending on that country?

Lets say I want to show CPA offers for US and othe offers for UK or other countries.

Can this plugin shows different offers for US, UK and so on?
If not do you plan to create this feature?

Thanks

sameer

March 16th, 2012 at 8:53 am

Yes, it. Can do that. Check the documentation above.

sameer

March 16th, 2012 at 8:54 am

Yes, it can do that.

75

sunny

April 22nd, 2012 at 3:00 pm

i already bought your plugin and i already installed the pluggin succesfull. But i can’t find menu to setting. where can i find the menu?

76

sunny

April 22nd, 2012 at 4:13 pm

sorry to ask again.. how to use “Filtering other content” in widget. My purpose to bought your plugin is to filtering the adsense script on my widget, Now i want to ask how to use this script

“.
.

// The content here is displayed only for users
// browsing from US, UK or Australia.

// People from other countries will see the content
// given here but not the above.

.
.”

and where i should put the script in. sorry im so newbie about the coding.
and one more question. to use the script above which plugin i should use. is it “Country Filter ( ip2nation )” OR “Country Filter ( MaxMind GeoIPLite )”

Hope to hear from you soon

Thnaks

Sunny

77

Mahesh

June 8th, 2012 at 5:28 am

I want to serve 5 pages from my site to be served to a specific country and other 5 to global visitors excluding the 1 country,what is the code and which plug in will it work with?

78

mustafa kırmızı

June 25th, 2012 at 11:44 am

ovv great!

79

Eric

September 27th, 2012 at 7:18 am

Hi,

I would like to use the filter like this:

// The content here is displayed only for users
// browsing from US.

// The content here is displayed only for users
// browsing from The Netherlands.

// People from other countries will see the content
// given here but not the above.

So i want more seperate countries with different content plus general content for all other countries. Is this possible? if yes, how should the code look?

Thanks in advance!

sameer

September 27th, 2012 at 8:20 am

Check this sample code:

http://pastie.org/4830109

81

Elton

October 30th, 2012 at 1:09 am

This is exactly what I am looking for. Can the shortcode method hide or display a piece of HTML code? I am trying to hire a Paypal buy now button HTML code from certain countries. Thanks in advance.

sameer

October 30th, 2012 at 3:37 am

Of course you can show/hide HTML code using the shortcode method.

83

Geoffroy

November 2nd, 2012 at 4:03 am

Hi,

I would like to know if you have a affiliate link for your plugin ?

Thanks

Geoffroy

sameer

November 3rd, 2012 at 8:59 pm

At present the plugin does not have any affiliate links, however I’m planning to add one in the future.

85

Geoffroy

November 9th, 2012 at 8:30 am

OK because I am interested to do an article on my blog in French. I would also like to use the plugin to display ads based on country.
Do not hesitate to tell me.

Thanks

86

Calin

November 14th, 2012 at 4:49 am

Hello there! I just got the plugin, installed it and it ran fine for a while, before it completely killed my site and all I am getting now is internal server errors.

I am running a medium-sized blog (about 30,000 page views per day) on a dedicated server, but it seems that the requests are for much for it to handle. Is there any way to make it work?

sameer

November 14th, 2012 at 5:28 am

Hello!

This should not happen, as it has been used for sites with in excess of 45000 users. Can you send your site url.

88

Calin

November 21st, 2012 at 2:43 am

It might have been just a coincidence – the plug-in worked fine since then until now, and yesterday I had over 50,000 page views. Now all it has to do is to grow and get a 99.9% rate :) Either way, good job!

89

cesar mejia

December 3rd, 2012 at 5:39 am

hi! which is the country code for Guatemala ?¿ Thank you!

sameer

December 3rd, 2012 at 7:02 am

91

Lucienne

January 10th, 2013 at 2:11 am

Hi,

We have a press website (running on WordPress 3.5), where users can registrate without moderation. Now, we get a lot of post spammers from China and USA. Is it also possible to block /wp-login.php for different countries? And is it also possible to allow only 1 or 2 countries, or can we only disallow countries?

92

Val

March 8th, 2013 at 9:29 am

Great job, it really works but Chrome doesn’t seem to have the will to obey. I forbade the vision of some video in my country but with Chrome I still can watch the restricted videos. Any advice?

93

Dimitris

August 11th, 2013 at 2:27 pm

Hi, maybe you can use this technique to make your plug-in work with WP super cache.

http://omninoggin.com/wordpress-posts/make-any-plugin-work-with-wp-super-cache/

I would love to buy your plug-in if you finally make it.

94

http://fashionsx.org

September 5th, 2013 at 11:10 pm

hello.. is it possible to filter from all Asian country?

sameer

September 5th, 2013 at 11:12 pm

You will need to specify all the Asian country codes, which I can understand can be tedious. I’ll add the feature in the next version to filter by continents.

96

Søren Wahlgren

September 18th, 2013 at 1:21 am

Hi,

I bought the plugin and I’m currently trying to implement it. I want to show a different affiliate link to people within and outside of the EU respectively. Can this be done without a mile long list of countries in the shortcode?

sameer

September 18th, 2013 at 2:10 am

Not at present as the plugin was primarily developed to filter between a few countries. However, I’ve received a few requests to filter by EU, continents etc, which I’ll implement in the coming version of the plugin.

Till then you will have to do by adding all the country codes in the shortcode. Will email you the new version once it is ready.

98

Søren Wahlgren

September 18th, 2013 at 9:26 am

The task wouldn’t be so difficult if one could just find a list of EU countries and non-EU countries to copy/paste in to the code. I’m currently looking for such a list and will post it here if I find one.

99

Peter

September 22nd, 2013 at 3:10 pm

I was wondering if there is a way to break it down further by filtering by state and or province (US and Canada)?

sameer

September 23rd, 2013 at 4:33 am

Not at present, but it is in the works and will probably be available in the next version or as a different plugin.

101

James

October 4th, 2013 at 1:15 am

Hi Sameer

this looks like exactly what we need (showing different footer and sidebar elements to different countries) but my concern is if we use the shortcodes to swap out page content will Google see this as cloaking?

Because it will see multiple content versions sitting on the same url. Could this then get us penalised?

I assume Google will see what is onscreen and not what is in the code? (actually if we are hiding content does it still appear in the source code or does it get removed before appearing in the browser?)

This seems to be my only concern as I have an international client who is reliant on seo and this could be crippling.

many thanks

James

sameer

October 4th, 2013 at 6:17 am

Honestly, with such quick changes in Google algorithms it is hard to know. As now many leading sites rearrange content depending on the users country maybe Google will turn a blind eye to the issue. Than again, if your clients site is heavily dependent on SEO, I’d suggest you research some more. I’ll also check from my side.

103

Profesor Yeow

January 14th, 2014 at 10:10 am

Works with WordPress 3.8+ ??
Ask me please, I thinking in buy it :) Thanks!

sameer

January 14th, 2014 at 10:06 pm

This has been tested with WordPress 3.8+.

105

Andrew

January 27th, 2014 at 7:40 pm

I too wish to know if this plugin is compatible with wordpress 3.8+ and is well supported and updated.

sameer

January 27th, 2014 at 7:43 pm

Yes Andrew, it has been tested upto 3.8

107

Pedro

February 3rd, 2014 at 5:18 am

Hi,

I think I am looking for a plugin like this.
I have some questions:

1.
I would want to show Adsense to some country visitor and other banners to visitors from other countries. Can I do that with this plugin?

2.
Does it work with WP Super Cache?

3.
On the other hand, I would want to know if there is any demo version to try it, because I have bought some plugins that finally didnt worked or they werent what I espected, so I want to try it before buying it.

Thank you!

sameer

February 3rd, 2014 at 8:09 am

1. You can accomplish the point mentioned.
2. No, this does not work with any cache plugin.
3. There is no demo version to try.

109

Kyle

February 19th, 2014 at 3:25 pm

I keep getting this error on activation… I followed your instructions, and still have the error.

Warning: require_once(geoip.inc): failed to open stream: No such file or directory in /var/www/vhosts/jobscience.com/webtest/wp-content/plugins/country-filter/country-filter.php on line 32 Fatal error: require_once(): Failed opening required ‘geoip.inc’ (include_path=’.:’) in /var/www/vhosts/jobscience.com/webtest/wp-content/plugins/country-filter/country-filter.php on line 32

110

Jeanna

March 1st, 2014 at 8:11 am

Does your plugin work with Wp Minify plugin or any minify plugin?

sameer

March 2nd, 2014 at 8:37 pm

Yes, it works with the WP Minify plugin.

112

Sarah

March 23rd, 2014 at 7:22 pm

Hi, just bought your plugin. in your instructions you say to download a file here: http://www.maxmind.com/download/geoip/api/php/php-latest.tar.gz
This returns the message “invalid archive directory”. I’ve taken a look at their website but really have no idea what i’m looking for. Please advise.
thanks,

sameer

March 23rd, 2014 at 7:45 pm

Hello Sarah,

I’ve sent the 2 files to your email id.

114

Jennifer

March 28th, 2014 at 7:47 pm

Hello! First of all the plugin worked like a charm. I do see one issue and I’m not sure what I can do about it. When I used my safari browser on my phone, it displays properly. When I click on the link within facebook, it shows the american content, even though I am in Canada. Is there any way to get around this?

sameer

March 28th, 2014 at 8:58 pm

Hello,

Really not sure what you are saying. Can you please give me your site url.

116

Jennifer

March 28th, 2014 at 9:59 pm

What is your email? I can send you the details there.

sameer

March 28th, 2014 at 10:01 pm

118

Sarah

March 31st, 2014 at 12:22 am

Hi, probably a silly question, but wondering if there is any way i can check my code. If I’m blocking something from appearing in my country, or only in another country, then i can’t see that it’s really there if you see what i mean. Is there a workaround?

sameer

March 31st, 2014 at 7:36 am

You need to use some online proxy servers that route your website traffic from a selected country of your choice. This enables you to verify if the code works correctly.

120

JC

April 16th, 2014 at 12:15 am

Hello,

Very excited about the plugin and you seem on the ball with support!

I am going to purchase it today and use to display widgets that contains Double Click for Publishers (the google adverts) based on country codes as some of the sizes the client wants is only for certain countries.

REF Sarah – She can use Hidemyass, I can give a link if required and they have super loads of countries it works best to test this.

Hope I get it setup the first time correctly lol

121

James

April 16th, 2014 at 12:41 am

Hi,
Does your plugin work with MUltisite?

sameer

April 16th, 2014 at 12:50 am

Honestly, have not tested on multisite.

123

Ro

April 23rd, 2014 at 7:10 am

Hi Sameer,

I just bought and installed the plugin plus the geo IP stuff but content within the shortcodes is not displaying correctly. When I set display=”0″, the content within the shortcode displays and when I set display=”1″, the content his hidden, regardless of country. It seems to be the reverse of what should happen, and it doesn’t seem to be picking up any geoIP value. Do you know what i’m doing wrong? Are there further settings required than installing the plugin and the two geoIP files? Any help you can give would be great!

Thanks,
Ro

sameer

April 23rd, 2014 at 7:28 am

Check if any cache plugin are activated. The plugin does not work with cache plugins : wp-supercache etc.

125

Ro

April 24th, 2014 at 12:59 am

Hi Sameer,
I have no cache plugins in operation at the moment – do you know if there have been other cases where similar problems have happened, or what else I can check to try to get Country Filter working?

Currently I have Akismet, Gravity Forms and a few custom-post and shortcode plugins, as well as Revolution Slider and Yoast SEO. None of these seem a likely cause, and I need to keep them active anyway.

Any help you can give would be great!

Thanks,
Ro

sameer

April 24th, 2014 at 5:36 am

If you read the documentation above:

…People in other countries will not be able to see the string. On the other hand, setting the display attribute to ’0′ will hide the content for users in US and India but will display the string to people from other countries as given in the following code. …

The plugin is working correctly, most probably your IP is behind a proxy and is returning an incorrect location. This happens many times for proxy servers.

Can you set a certain page to display some text and add the country code ‘in’ to the shortcode so I can check from my side.

127

Vahid

April 26th, 2014 at 11:51 am

Hello.

iControlWP have a good plugin that can disable W3TC cache plugin to stop working while using custom content for each country .

Why don’t you add a same feature to your plugin??

Regards,
Vahid

128

Vahid

April 26th, 2014 at 12:00 pm

And can I tell the plugin to update database on monthly basis ?

129

Vahid

April 26th, 2014 at 12:01 pm

And can I tell the plugin to update the IP 2 country database on monthly basis ?

sameer

April 26th, 2014 at 10:35 pm

Currently you have to do that manually, but the next version will include the feature. But that is a few months away.

131

jump manual scam

May 13th, 2014 at 5:06 pm

Great information. Lucky me I came across your site by chance (stumbleupon).
I have saved as a favorite for later!

Your thoughts