This is a WordPress plugin for creating blocks of content that are shown or hidden based on the visitor's country.
You need to install and configure mod_geoip or the nginx equivalent so that the environment variable GEOIP_COUNTRY_CODE is set properly. PHP version 5.3 or greater is required.
[geoblock type='blacklist' countries='xx,yy,zz'] my beautiful content [/geoblock]
The countries argument consists of 2 letter ISO country codes separated by commas.
Just replace type='blacklist' with type='whitelist' to show content to visitors from specific countries only while blocking everyone else.
Message to blocked users
If you want to show a message to blocked users add the message argument:
[geoblock type='blacklist' countries='xx,yy,zz' message='Sorry but this content is not available in your area'] This content will show up in all countries other than xx,yy,zz [/geoblock]
This works for both whitelists and blacklists. The message argument can only contain plain text messages. For more complex messages create both a blacklist and a whitelist block.