Install & Setup

WP-Geolocation-JS Download, Installation, Upgrade and Setup Instructions

Overview

The WP-Geolocation-JS plugin is a WordPress plugin that uses your visitor’s IP address to display their geographical information anywhere in your WordPress theme.

Using the MaxMind free JavaScript geolocation service, the plugin can display a visitor’s country, city, state/province, longitude and latitude using WordPress shortcodes.

Download WP-Geolocation-JS (2674)

Installation Instructions

  1. Extract the downloaded plugin to /wp-content/plugins/
  2. Activate the plugin from the WordPress plugin admin page

Usage Instructions

  • Within any blog post or page, you can use the following shortcodes:
[mmjs-countrycode] - the ISO 3166-2 country code
[mmjs-countryname] - the country name
[mmjs-city] - the city name
[mmjs-region] - the ISO 3166-2 country code (state or province abreviation)
[mmjs-regionname] - the region name
[mmjs-lat] - latitude
[mmjs-long] - longitude
[mmjs-postalcode] - post/zip code
[mmjs-ip] - ip address
  • The plugin also generates corresponding  JavaScript variables in your theme for use with JQuery, dynamic forms, etc:
mmjsCountryCode
mmjsCountryName
mmjsCity
mmjsRegion
mmjsRegionName
mmjsLat
mmjsLong
mmjsPostalCode
mmjsIPAddress

Troubleshooting

The correct city doesn’t get displayed!
The city is based on the IP address so it can be wrong for several reasons. If you live in a small town, a nearby larger city may be displayed. if your ISP is in another city, that city may be displayed. If you’re on a proxy server, the IP of the proxy server will be used, so the location of the proxy will be displayed.

The same city is always displayed!
This is often the result of a cached page (i.e. using wp-cache). Please turn off caching for the pages you wish to use this plugin on. There should be a field under the caching plugin options to add pages to exclude.

Is anything saved in my MySQL database? Can I keep track of visitor locations?
In short, no. This plugin is focused on being lightweight and fast. You may wish to look at other plugins with more features like Firestats or Geoplugin.

Is there anything to update or download?
Nope! WP-Geolocation-JS uses calls to MaxMind’s free JavaSciprt geolocation service, so it’s fast, lightweight, and free!

Do you take donations? How can I thank you?
Well, if you’re gonna twist my arm, I guess I could accept a cup of coffee. Thanks!