All lookups run locally on your server with no outbound API request on page load.
WordPress Plugin by Monday Digital
Self-hosted IP geolocation for WordPress.
No API fees. No rate limits. No visitor data leaving your server.
GeoIP2 Self-Contained downloads the geolocation database to your own hosting and runs lookups locally.
- Lookup model
- Local database
- Database sources
- DB-IP + MaxMind
- Integration options
- Shortcode, PHP, forms
Quick Start
Get geolocation running in minutes
The default DB-IP setup is intentionally lightweight: install the plugin, trigger the first database download, confirm the local files are ready, and start using the shortcode or PHP function.
- Install and activate the plugin in WordPress.
- Click Download Now in the first-run admin notice.
- The plugin downloads
geoip2.pharand the selected geolocation database. - Files are stored in
wp-content/uploads/geoip/with web-access protection. - Confirm both resources show as ready in the Status panel.
Overview
Why this plugin exists
Most geolocation plugins call a remote API on every page load. That adds latency, creates a new third-party dependency, and sends visitor IP data off-server. GeoIP2 Self-Contained flips that model.
It downloads the database to your own WordPress host once, performs each lookup locally, and keeps the data fresh with scheduled updates. The default DB-IP setup works without an account, while MaxMind GeoLite2 is available for teams that want an alternate free source.
Use it anywhere in your WordPress stack
- Insert
[geo_visitor_info]into pages or hidden form fields - Call
geoip2_get_visitor_geo_data()in custom themes and plugins - Capture location data inside Gravity Forms, WPForms, CF7, Elementor Forms, or custom HTML forms
Core Features
Why teams choose this for production WordPress sites
DB-IP City Lite works out of the box without sign-up, API key, or credit card.
Refresh schedules are configurable from 1 to 30 days so geo data stays current.
Visitor IP addresses are not transmitted to external services during lookups.
Use a shortcode for content teams or a PHP function for theme and plugin developers.
Drop location data into hidden fields for Gravity Forms, WPForms, CF7, Elementor, or custom forms.
Reads the real visitor IP from CF-Connecting-IP when Cloudflare is in front of the site.
Choose DB-IP City Lite or MaxMind GeoLite2 depending on your workflow and data preference.
Downloaded files are protected with .htaccess and index.php guards.
Every download attempt is written to a local log with rotation at 5 MB.
Use Cases
When this plugin makes sense
Capture country, city, or region inside forms so sales or support teams can triage submissions faster.
Show geography-aware content without sending visitor IP data to third-party APIs on every request.
Roll out a consistent setup across client sites where predictable hosting behavior matters more than flashy extras.
Use local geodata in templates, plugins, and integrations through a shortcode or direct PHP access.
Returned Data
What each lookup can provide
Technical Specifications
Deployment-ready at a glance
| Current version | 1.0.0 |
|---|---|
| Requires WordPress | 5.8 or higher |
| Tested up to | 6.8 |
| Requires PHP | 7.4 or higher |
| Required PHP extensions | zlib, phar |
| License | GPL-2.0+ |
| Database sources | DB-IP City Lite, MaxMind GeoLite2 City |
| Default source | DB-IP, no account needed |
| Storage location | wp-content/uploads/geoip/ |
| Cron schedule | Configurable from 1 to 30 days |
| Shortcode | [geo_visitor_info] |
| PHP function | geoip2_get_visitor_geo_data() |
| Multisite | Single-site activation only |
| Author | Monday Digital |
Pricing & Licensing
Free and open source from day one
GeoIP2 Self-Contained is completely free under the GPL-2.0+ license. No premium tier, no feature locks, and no upsells. Download it, use it, and modify it.
Product Screens
A visual tour of the plugin workflow
Settings page overview
Configuration, status, manual actions, and update log in one full admin view.
First-run admin notice
The activation prompt that requests the initial database and library download.
Status panel
Ready and installed badges for the database file and GeoIP2 reader library.
Visitor log
Paginated admin log view for recorded visitor lookups when logging is enabled.
Shortcode output
Frontend rendering of [geo_visitor_info] on a content page.
Form builder example
Hidden field usage inside a form builder workflow for location-aware submissions.
Changelog
Initial release highlights
- Self-hosted DB-IP City Lite database (no account needed)
- Optional MaxMind GeoLite2 support with free license key
- Automatic downloads and scheduled database refresh (configurable 1–30 days)
[geo_visitor_info]shortcode with 1-hour per-IP transient cachegeoip2_get_visitor_geo_data()PHP function for developers- Visitor location logging with hourly rate limiting (disabled by default)
- Cloudflare-compatible real IP detection (
CF-Connecting-IP) - Source tracking — warns if installed MMDB source does not match selected source
- Log rotation at 5 MB with dated backup files
.htaccessandindex.phpprotection for all uploaded files- Paginated visitor log viewer in the admin panel
- GDPR privacy policy content block registered with the WordPress Privacy tool
- Source mismatch detection and admin warning with one-click update action
Documentation Snapshot
First-run flow for site owners
- Install and activate the plugin in WordPress.
- Click Download Now in the first-run admin notice.
- The plugin downloads
geoip2.pharand the selected geolocation database. - Files are stored in
wp-content/uploads/geoip/with web-access protection. - Confirm both resources show as ready in the Status panel.
Operational notes
- Optional visitor logging is disabled by default for privacy.
- WordPress Cron handles scheduled database refreshes.
- For low-traffic sites, a real server cron can improve update reliability.
- Switching database sources queues a fresh background download automatically.
Support & Updates
Clear expectations for maintenance and help
- Updates are delivered through the standard WordPress plugin update flow when new versions are published.
- Setup guidance is available on this page and through the WordPress.org plugin listing.
- Monday Digital can help with implementation questions, deployment support, and practical usage guidance.
- The release approach stays focused on production-ready value, privacy, and maintainability instead of upsell-driven complexity.
Quick trust cues
FAQ
Common questions from plugin users
No for the default setup. DB-IP City Lite works without any account or license key. Just install, click Download Now in the admin notice, and you're ready. MaxMind GeoLite2 is optional and requires a free MaxMind license key.
No. Lookups run locally against a file on your server — typically under 1 millisecond. There is no outbound HTTP request on any page load. The shortcode output is also cached per-visitor IP for one hour.
In your WordPress uploads folder, at wp-content/uploads/geoip/GeoLite2-City.mmdb. The GeoIP2 PHP reader library (geoip2.phar) is stored in the same folder. Both are protected from direct web access.
Automatically, on the schedule you set (default: every 7 days). DB-IP updates their free database monthly. MaxMind releases GeoLite2 updates on the first Tuesday of each month.
Yes. The plugin automatically reads the real visitor IP from the CF-Connecting-IP header when Cloudflare is in use.
Yes. Place the [geo_visitor_info] shortcode in a hidden field in Gravity Forms, WPForms, Contact Form 7, Elementor Forms, or a plain HTML form. The visitor's location data is included in the form submission.
No. All lookups are performed locally using the self-hosted database. The only external connections are the scheduled database download from DB-IP or MaxMind, and the one-time download of geoip2.phar from GitHub. No visitor IP addresses are ever transmitted externally.
Visitor logging is disabled by default. If you enable it, you must update your site's privacy policy to disclose the data collection. The plugin provides suggested privacy policy content in the WordPress Privacy tool under Settings > Privacy.
The plugin supports single-site activation. It can be activated per-site on a multisite network but does not support network-wide (network activation) use.
Related Links
Explore more in the Lab catalog
See the wider plugin directory and compare release posture, update style, and deployment fit.
Review release highlights and future Lab release history in one place.