Geo IP at WP Engine

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

If you host your WordPress at WP Engine, you’re interested in utilizing Geo IP, and your plan allows it, ask the Support team to move you to a compatible server and to enable Geo IP. Once you install and activate the WP Engine Geo IP plugin, then everything should start working without issue.

The following is an example of WP Engine’s Geo IP offerings and should display your geographic information. The shortcodes to use can be found underneath:

Country: US
Region (State): VA
City: Ashburn
Postal Code: 20149
Latitude: 39.04810
Longitude: -77.47280
Location: Ashburn, VA US


Country: [geoip-country]
Region (State): [geoip-region]
City: [geoip-city]
Postal Code: [geoip-postalcode]
Latitude: [geoip-latitude]
Longitude: [geoip-longitude]
Location: [geoip-location]

Note: Shortcodes only display this information back to the visitor. You may not be able to use it in conjunction with other plugins. You will usually need to resort to PHP coding to do more advanced processes. Here is the class and functions you can use to obtain this information. Note the GeoIP class you’ll need to initialize:

With that, you could do more advanced functions with conditional statements. The following will perform a redirect using wp_redirect() if the visitor’s country is “US”:

While you can certainly use the GeoIP class, the geo information can also be found in the environment variables. This is the information/array used to set the Geo info:

With that information, just note that outside of the plugin not working, you won’t be able to ask WP Engine for assistance with coding. There’s also no guarantee that the code above is functional and is to only be used for demonstration purposes.

New with WP Engine GeoIP v.1.1

The latest update to the WP Engine GeoIP plugin introduces new shortcodes. For instance, you can display text for a certain country, region, or exclude text from a city:

In addition, you can easily test these changes by adding query arguments to the end of the URL:

So instead of using a proxy or VPN, you can visit your website as a visitor from Canada:



Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

WordPress 3.6.0 introduced the Heartbeat API. It’s the backbone to some of the new features such as session management, better revision management, post locking, auto-saving and more. Unfortunately, it also introduced increased CPU usage when logged into the WordPress Dashboard.

The issue lies in the way the Heartbeat API works. When logged in, your browser sends a POST request to wp-admin/admin-ajax.php every 15 seconds when your tab is active and every 120 seconds when your tab is in the background. Since it’s sending a POST request, it’s spawning a new PHP process. This isn’t so much an issue if you have a single tab open but the problem lays for users who like to keep multiple tabs open at a time while logged in to the Dashboard. Take a look at the following POST request data:

Continue reading