WPGeocode

WP Geocode is a WordPress plugin which enables you to leverage geographic information about your blog readers.

If you’ve been doing business online for any length of time, you already understand the value of researching the data available about your web site viewers. Tools like Google Analytics is a great help because it shows you valuable data about the viewers of your web site. The problem is that it this data is not exactly timely. That’s where WP Geocode comes in.

WP Geocode let’s you create content customized for the individual user based on where they are when they view your site.
Imagine you want to target folks in a local shopping mall. Perhaps, they’re in a local coffee shop on a wifi connection. We’d simply need to get the latitude and longitude coordinates of the coffee shop and use those in our wordpress post.

There are two types of shortcodes implemented by wpgeocode. The first is data shortcodes. These are shortcodes which enable you to utilize geocode data in your posts or pages. For example, [wgc_city] will be replaced by the city of the current reader of your post or page. The second type of shortcode implemented by wpgeocode is a conditional shortcode. These enable you to conditionally include content if specific geocode conditions are met. For example, [wp_is_state_code state='PA'] SOME TEXT [/wp_is_state_code] will display SOME TEXT for readers of the page or post that are currently in PA. For full details, see http://www.wpgeocode.com

Plugin Statistics

[wpws url = "http://wordpress.org/extend/plugins/wpgeocode/stats/" selector="div .col-3 p" cache="60" timeout="3" error="cache"]

Shortcodes

Shortcodes
Use these shortcodes to incorporate reader geolocation data into your blog posts
[wpgc_ip] – IP Address of the reader
[wpgc_city] – City of the reader
[wpgc_state_name] – State name of the reader
[wpgc_state_code] – Two letter State code of the reader
[wpgc_postal_code] – Five digit Postal code of the reader (eg: [wpgc_postal_code])
[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
Use these shortcodes to display customized content in your blog posts to readers

[wpgc_is_city_and_state city=”Yardley” state_code=”PA”]
[wpgc_is_ip ip=”xx.xx.xx.xx”]
[wpgc_is_not_ip ip=”xx.xx.xx.xx”]
[wpgc_is_city city=”"]
[wpgc_is_not_city” city=”"]
[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_code country_code=”"]
[wpgc_is_state_name state_name=”"]
[wpgc_is_state_code state_code=”"]
[wpgc_is_not_country_name country_name=”"]
[wpgc_is_not_country_code country_code=”"]
[wpgc_is_not_state_name state_name=”"]
[wpgc_is_not_state_code state_code=”"]

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] Stop on over, since you’re in the area.[/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.

More Examples

There are several pages on this blog that incorporate examples of WPGeocode:

3 thoughts on “WPGeocode

  1. This is a great plugin. I just wished that it would have an option to get the location of not only the reader but the post author as well and lock that in the post. That way you can only show that post to the people in that city or state. I’m working on a dating site and this would make everything so easy because right now I have to ask the profile owners to enter their location and also ask viewer to filter the location that they want to see posts from.

  2. Just wanted to stop by and thank you for making a great plugin. This has tremendously saved me time, and I want to say thanks for doing such a fine job with it.

    • I did have a quick question about this plugin though. How would I be able to get it to work with Super Cache? I don’t want it to cache the specific content that I put for each state.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>