WordPress.org

Ready to get started?Download WordPress

Plugin Directory

WP Geocode Filter

Use WPGeocode to customize the content of your blog based on the location of your readers.

WP Geocode enables WordPress publishers to customize content based on the Geolocation information of the reader.

WP Geocode implements shortcodes that let publishers incorporate reader's geolocation data into posts, and post titles. Additionally, publishers can use shortcodes in posts which let them tailor post content to the reader based on proximity or location. This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/.

Use WP Geocode to customize the content of your blog based on the geographic location of your readers.

Available Filter Shortcodes

This filter content in the article body, title based on the reader's geolocation data:

  • [wpgc_ip] - IP Address of the reader
  • [wpgc_city] - City of the reader
  • [wpgc_state_code] - Two letter State code of the reader
  • [wpgc_country_name] - Country name of the reader
  • [wpgc_country_code] - Two letter Country code of the reader
  • [wpgc_latitude] - Latitude of the reader
  • [wpgc_longitude] - Latitude of the reader

Conditional Shortcodes - Only available in the body of the post:

  • [wpgc_is_city_and_state city="Yardley" state_code="PA"]
  • [wpgc_is_ip" ip="xx.xx.xx.xx"]
  • [wpgc_is_ips" ip="xx.xx.xx.xx,aa.bb.cc.dd"]
  • [wpgc_is_not_ip" ip="xx.xx.xx.xx"]
  • [wpgc_is_not_ips" ip="xx.xx.xx.xx,aa.bb.cc.dd"]
  • [wpgc_is_city" city=""]
  • [wpgc_is_cities" cities="city one,city two,city three"]
  • [wpgc_is_not_city" city=""]
  • [wpgc_is_not_cities" cities="city one,city two,city three"]
  • [wpgc_is_nearby"] - Uses the value you specify in the Nearby Range setting from the administrative panel
  • [wpgc_is_not_nearby"]
  • [wpgc_is_within" miles="10"]
  • [wpgc_is_within kilometers="12"]
  • [wpgc_is_country_name" country_name=""]
  • [wpgc_is_country_names" country_name="United States,Egypt,Albania"]
  • [wpgc_is_country_code" country_code=""]
  • [wpgc_is_country_codes" country_codes="US,GB,AZ"]
  • [wpgc_is_state_code" state_code=""]
  • [wpgc_is_state_codes" state_codes="PA,NJ,TX"]
  • [wpgc_is_not_country_name" country_name=""]
  • [wpgc_is_not_country_names" country_names="United States,Egypt,Albania"]
  • [wpgc_is_not_country_code" country_code=""]
  • [wpgc_is_not_country_codes" country_codes="US,GB,AZ"]
  • [wpgc_is_not_state_code" state_code=""]
  • [wpgc_is_not_state_codes" state_codes="PA,NJ,TX"]

Examples

[wpgc_is_nearby] Hi Neighbor! [/wpgc_is_nearby] - Will display "Hi Neighbor!" to readers within a configurable distance from your home base.
[wpgc_is_within miles=10] Come on over! [/wpgc_is_within] - Will display "Come on over!" in the post body if the user is viewing the post from within 10 miles.
[wpgc_is_ip ip=123.123.123.123] I used to own this IP Address [/wpgc_is_ip] - Will display the message only if the user has that specific IP Address.
[wpgc_is_city city="Yardley"] Hello Fellow Yardlian [/wpgc_is_city] - Will display the message only if the user has that specific IP Address.
[wpgc_is_not_cities cities="Yardley,Morrisville"] Glad you don't live in Yardley or Morrisville? [/wpgc_is_not_cities] - Will display only when visitor is not viewing the page from Yardley or Morrisville

Configurable options allow you to set a default phrase for each available shortcode in the event that the user was unable to be geo-located.

Requires: 3.0 or higher
Compatible up to: 3.2.4
Last Updated: 2013-7-2
Downloads: 4,189

Ratings

3 stars
3.6 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

0,1,0
0,1,0
100,1,1 100,1,1 100,1,1
100,1,1
100,2,2
100,1,1
0,1,0