I created a new WordPress plugin called GeoBlock that allows you to show or hide content based on the visitor’s country. This plugin is not for people on shared hosting. It is for those of you who have root access to their own VPS or dedicated servers.
First up you have to install mod_geoip or the Nginx equivalent module for that. The instructions here are for configuring the Nginx version on a Debian system.