Title: WPLocation &#8211; Geolocation and Country Rules
Author: Jazib Zaman
Published: <strong>November 2, 2026</strong>
Last modified: November 2, 2026

---

Search plugins

![](https://ps.w.org/wplocation/assets/banner-772x250.png?rev=3779487)

![](https://ps.w.org/wplocation/assets/icon-256x256.png?rev=3779487)

# WPLocation – Geolocation and Country Rules

 By [Jazib Zaman](https://profiles.wordpress.org/wplocation/)

[Download](https://downloads.wordpress.org/plugin/wplocation.1.0.0.zip)

 * [Details](https://wordpress.org/plugins/wplocation/#description)
 * [Reviews](https://wordpress.org/plugins/wplocation/#reviews)
 *  [Installation](https://wordpress.org/plugins/wplocation/#installation)
 * [Development](https://wordpress.org/plugins/wplocation/#developers)

 [Support](https://wordpress.org/support/plugin/wplocation/)

## Description

WPLocation is a country visibility plugin for WordPress. Set an audience for posts,
pages or categories, use the country visibility block or [wplocation_target] shortcode,
and display a detected country with [wplocation_country]. The admin menu includes
Settings, Diagnostics and a private activity log. Pro and optional add-ons are distributed
separately; no paid feature code is bundled or locked inside this plugin. Pro 1.4.4
or newer recognizes this directory edition as a compatible Free base; Pro itself
requires PHP 8.3.

The plugin needs a current, licensed GeoLite2 Country MMDB. It does not bundle location
data. You can select a private server file or use your own MaxMind account ID and
license key to download one from Settings. Automatic updates are opt in and off 
by default. When enabled, the updater contacts MaxMind for an authorized download
and follows its signed Cloudflare R2 file URL. The providers receive your site’s
server IP and MaxMind receives the account credentials. Visitor IPs remain on your
server during local lookups and are not sent by the updater. See https://dev.maxmind.
com/geoip/geolite2-free-geolocation-data/, https://www.maxmind.com/en/geolite/eula,
https://www.maxmind.com/en/privacy-policy and https://www.cloudflare.com/privacypolicy/.

Saved MaxMind credentials are non-autoloaded WordPress options, not encrypted at
rest; they may appear in database backups. For stronger secret management, define
WPLOCATION_MAXMIND_ACCOUNT_ID and WPLOCATION_MAXMIND_LICENSE_KEY in wp-config.php.
Those constants take priority. The plugin does not display saved keys or record 
them in its activity log.

Store the MMDB outside the public web root. Automatic updates save validated copies
beside the configured source, select them atomically and retain the last working
file on failure. Recorded unchanged retired copies can be removed after two days;
configured and untracked files remain the site’s responsibility. WordPress cron 
needs traffic or a server cron. Follow MaxMind’s database update and deletion requirements.
This product can use GeoLite Data created by MaxMind, available from https://www.
maxmind.com/.

Geolocation is approximate and these rules are for personalization, not access control
for confidential content. When a country cannot be determined, restricted content
is hidden. Caches and CDNs can serve the wrong country or bypass WordPress altogether.
While Free is active, the plugin requests no-store responses for frontend HTML and
country-aware post, page and search REST reads because targeted content can appear
in posts, blocks and secondary queries. It purges WP Super Cache when its API is
present, but you must configure and test any shared cache. Forwarded IP headers 
are not trusted by default; verified infrastructure can provide an address with 
the wplocation_verified_client_ip filter.

WPLocation’s older standalone 1.0.0 plugin cannot be replaced safely without preparation:
its old bundled database disappears when WordPress replaces the plugin folder, and
that database is outdated. This first directory release uses version 1.0.0 so WordPress
does not offer it as an automatic update to existing standalone 1.0.0 installations.
Do not manually overwrite the old plugin. Back up the site and rules, prepare a 
current licensed database outside the old plugin folder, deactivate and remove the
old plugin, then install this release. Replace legacy [locationtarget] shortcodes
with [wplocation_target] in content before removing the old plugin. The legacy settings
use the same option names, so review and test every rule after migrating. A future
version above 1.0.0 requires a separate, tested upgrade path.

The combined plugin is GPLv3 or later and contains third-party libraries under their
own licenses, including Apache-2.0 MaxMind libraries. See THIRD-PARTY-NOTICES.txt
and vendor license files.

## Screenshots

[⌊Select the countries that can see a WordPress page and review the resulting audience.⌉⌊
Select the countries that can see a WordPress page and review the resulting audience
.⌉[

Select the countries that can see a WordPress page and review the resulting audience.

[⌊Check whether the private country database is ready and when it was built.⌉⌊Check
whether the private country database is ready and when it was built.⌉[

Check whether the private country database is ready and when it was built.

## Blocks

This plugin provides 1 block.

 *   Country visibility

## Installation

 1. If migrating from the standalone WPLocation plugin, back up the site and follow
    the migration steps above before removing it.
 2. Install and activate WPLocation.
 3. In WPLocation > Settings, select an existing private GeoLite2 Country MMDB or save
    your own MaxMind credentials and download one. Alternatively define WPLOCATION_GEOIP_DB_PATH
    in wp-config.php; this constant takes priority. Illustrated setup: https://wplocation.
    com/documentation/maxmind-geolite2-country-setup/.
 4. In Diagnostics, verify the database date and run a private IP lookup. Create a 
    country rule and test the page with your actual cache and CDN configuration.
 5. If you enable automatic updates, monitor WordPress cron and the update status. 
    Purge external page and CDN caches after plugin, data or rule changes.

## FAQ

### Does it work without a MaxMind account?

Yes, if you already have a current, licensed GeoLite2 Country MMDB that you can 
maintain. The in-plugin GeoLite download requires your own MaxMind account and license
key.

### Does it secure confidential content?

No. IP location is approximate. Other APIs, feeds, queries and caches may expose
content. Use WordPress access controls for confidential material.

### Is every page cache or CDN compatible?

No. A cache can serve an existing response before this plugin runs. Test targeted
URLs from different countries and bypass or vary shared cache entries when necessary.
WP Super Cache is purged on activation, updates and rule or data changes when its
API is available. Other caches need their own purge or configuration.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“WPLocation – Geolocation and Country Rules” is open source software. The following
people have contributed to this plugin.

Contributors

 *   [ Jazib Zaman ](https://profiles.wordpress.org/wplocation/)

[Translate “WPLocation – Geolocation and Country Rules” into your language.](https://translate.wordpress.org/projects/wp-plugins/wplocation)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/wplocation/), check
out the [SVN repository](https://plugins.svn.wordpress.org/wplocation/), or subscribe
to the [development log](https://plugins.trac.wordpress.org/log/wplocation/) by 
[RSS](https://plugins.trac.wordpress.org/log/wplocation/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.0

 * Preserve safe form fields in conditional content while filtering unsafe HTML.
 * Provide a compatibility marker for Pro 1.4.4 or newer without changing the migration-
   safe directory version number.
 * First WordPress.org submission candidate under the wplocation slug. It shares
   the legacy version number to avoid offering an unattended update to standalone
   1.0.0 installations.
 * Validate admin inputs as they enter the plugin and document why read-only navigation
   needs no nonce and why the update lock uses direct SQL.
 * Correct the MaxMind credential-removal checkbox layout and publish key-free GeoLite
   setup and data-source guides on wplocation.com.
 * Add post, page and category audience rules, country visibility block, country
   shortcodes, Diagnostics, Activity Log and mobile admin screens.
 * Support a private GeoLite2 Country MMDB and opt-in MaxMind downloads with validated
   file replacement, rollback and cleanup.
 * Clarify migration, data licensing, privacy and cache limitations. The DB-IP source
   is excluded from this directory edition while its attribution requirements are
   reviewed.

## Meta

 *  Version **1.0.0**
 *  Last updated **7 hours ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.8 or higher **
 *  Tested up to **7.1.4**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [country](https://wordpress.org/plugins/tags/country/)[geolocation](https://wordpress.org/plugins/tags/geolocation/)
   [geotargeting](https://wordpress.org/plugins/tags/geotargeting/)[visibility](https://wordpress.org/plugins/tags/visibility/)
 *  [Advanced View](https://wordpress.org/plugins/wplocation/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/wplocation/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/wplocation/reviews/)

## Contributors

 *   [ Jazib Zaman ](https://profiles.wordpress.org/wplocation/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/wplocation/)