WP.com Geo Uniques

Batcache-friendly way to handle geo-targetting of users at a country level.

Target distinct markets with different content while still benefitting from the awesomeness that is Batcache.

// add list of supported countries, probably in functions.php
wpcom_geo_add_location( 'us' );

// later on in your code
if ( 'us' == wpcom_geo_get_user_location() ) {
	echo "USA: A-Okay!";
} else {
	echo "You're not American! No soup for you!";
}

This plugin relies on WP.com-specific functions to be fully functional but will work in your local environment with WP_DEBUG === true.

Note that this should only be used with a very small list of countries for performance reasons. Please get in touch before using this plugin.