Description
EDZNET Geolocation brings the EDZNET Geo API into WordPress — no configuration required beyond an API key.
Features
- Shortcode: Display visitor location anywhere with
[edznet_geo]— flag, country, city, region, ISP, timezone, currency, continent, postal code, coordinates, ASN, connection type, proxy/VPN flag. - Geo-Content Shortcodes: Show or hide content by visitor country with
[edznet_geo_show country="US,CA"]and[edznet_geo_hide country="RU,CN"]. - Visitor Logging: Automatically log IP and location on comments, logins, and user registrations. Each entry shows the visitor’s country flag next to the IP. Smart caching avoids repeat lookups.
- Comment Moderation: One-click “Block IP” actions on the Comments screen.
- IP Blocklist: Block individual IP addresses or CIDR ranges from the visitor log or the Blocking page.
- IP Whitelist: Always allow specific IPs or CIDR ranges, bypassing all blocking.
- Country Blocking: Select countries to block. Visitors from blocked countries are redirected to a restricted page.
- Continent Blocking: Block entire continents (Europe, Asia, North America, etc.) in one click.
- Login Protection: Only allow logins from the countries you choose, or apply your country and continent blocks to logins. Covers wp-login.php, renamed login URLs, WooCommerce and other login forms, XML-RPC and application passwords. The country is only looked up when someone submits a login, so password-guessing bots use very few lookups.
- WordPress Widget: Drag-and-drop visitor location display in any widget area.
- Gutenberg Block: Insert visitor location directly into the block editor — no shortcode needed.
- CSV Export: Export the visitor log to CSV for external analysis.
- Client-Side Caching: Visitor location is cached in the browser’s localStorage so geo-content shortcodes and blocks display immediately on repeat visits without an AJAX call.
- API Rate Limiting: The AJAX/REST endpoint has built-in rate limiting to prevent abuse.
- Usage Dashboard: Monitor your API usage — lookups used, remaining, and reset date.
- Email Alerts: Get notified when your API credits are running low.
- API Key Encryption: Your API key is encrypted at rest using WordPress salts.
- Zero IP Retention: The API processes IP addresses in real-time and discards them immediately — no IPs are logged, stored, or retained, making it fully compliant with GDPR, POPIA, and similar privacy regulations.
Shortcode Examples
Display visitor flag and country:
[edznet_geo fields=”flag,country”]
Show all available fields:
[edznet_geo fields=”flag,country,city,region,isp,timezone,currency” class=”my-geo-box”]
Available fields: flag, country, city, region, isp, timezone, currency, continent, postal, coordinates, asn, connection, proxy, currency_symbol
Geo-Content Shortcodes
Show content only to visitors from the US or Canada:
[edznet_geo_show country=”US,CA”]This content is only visible to North American visitors.[/edznet_geo_show]
Hide content from visitors in Russia and China:
[edznet_geo_hide country=”RU,CN”]This content is hidden from visitors in these countries.[/edznet_geo_hide]
These shortcodes use AJAX to look up the visitor’s location, so they work with full-page caching plugins. Content inside [edznet_geo_show] is hidden by default and revealed via JavaScript — content inside [edznet_geo_hide] is visible by default and hidden if the visitor’s country matches.
Privacy & API Key Security
Keep your key private. Your API key is tied to your account. Do not share it, embed it in client-side code (JavaScript, mobile apps), or publish it publicly. You are responsible for all usage under your key.
Fair use. Creating multiple free accounts to circumvent rate limits is a violation of our Acceptable Use Policy and may result in suspension. If you need more lookups, upgrade your API plan at edznet.io/api-services.
No IP logging. The EDZNET Geo API processes IP addresses in real-time and does not log, store, or retain them. Looked-up IPs are discarded immediately after the response is sent. This makes the API fully compliant with GDPR, POPIA, and similar privacy regulations. The plugin itself caches lookup results locally (in your WordPress database) for 30 days to reduce API calls, but this data never leaves your server after the initial lookup.
External Services
This plugin uses the EDZNET Geo API, operated by EDZNET, to perform IP geolocation lookups (country, region, city, coordinates, ISP, timezone, ASN, connection type, proxy/VPN flags) for the shortcode, Gutenberg block, widget, visitor log, email alerts, country/continent blocking and login protection features.
What is sent and when. When a lookup is needed (a visitor loads a page with the [edznet_geo] shortcode or a geo-content shortcode, submits a comment, logs in, registers, the blocking feature is enabled and active, or login protection is on and someone submits a login or, if you choose, opens the login page), the plugin sends the visitor’s IP address and your API key to https://edznet.io/api/geo/v1/lookup. The service processes the IP in real-time and does not log, store, or retain it. Lookup results are cached locally on your server for 30 days per IP; repeat visitors are served from this cache without contacting the service.
The lookup endpoint is the only external service this plugin contacts.
Service terms. The EDZNET Geo API service is provided by EDZNET, a UK-based provider operating from ISO-certified data centres in London and Coventry, England:
* Terms of Service: https://edznet.io/terms-of-service.php
* Privacy Policy: https://edznet.io/privacy-policy.php
* Acceptable Use Policy: https://edznet.io/acceptable-use-policy.php
Installation
- Upload the
edznet-geolocationfolder to/wp-content/plugins/. - Activate the plugin.
- Go to EDZNET Geo → Settings and enter your free API key.
FAQ
How do I get an API key?
Visit edznet.io/api-services to sign up for a free account. The free tier includes 100 lookups per month.
Is my API key safe? Is it exposed to visitors?
Your API key is encrypted in the WordPress database and is never exposed to site visitors. The plugin sends it server-to-server to the EDZNET Geo API. It is not embedded in any HTML, JavaScript, or AJAX response.
Does the plugin cache lookups?
Yes. Results are cached for 30 days per IP. Repeat visitors from the same IP use the cached result.
Can I block entire continents?
Yes. Enable blocking in Settings, then check the continents you want to block on the Blocking page. Continent blocking is checked before country blocking.
Can I block entire countries?
Yes. Enable country blocking in Settings, then select countries to block in the Blocking page.
Can I block IP ranges with CIDR notation?
Yes. Both the IP blocklist and IP whitelist support CIDR ranges (e.g. 192.168.1.0/24, 10.0.0.0/8). Enter them one per line just like individual IPs.
Can I block specific IP addresses?
Yes. Go to the Blocking page to manually enter IP addresses or CIDR ranges, or click “Block IP” next to any entry in the visitor log.
Where do commenter country flags show?
Flags are shown in the admin Visitor Log next to each logged IP only. Flags are never shown on your site’s front-end comments.
How do I quickly block a commenter from the Comments screen?
Each comment row in the Comments screen has a “Block IP” action. Click it to instantly add that commenter’s IP to the blocklist; click again to unblock.
Is there a Gutenberg block?
Yes. Search for “EDZNET Geo” in the block inserter. It supports all the same fields as the shortcode.
Is there a WordPress widget?
Yes. Find “EDZNET Geolocation” under Appearance → Widgets. Configure the fields to display. (Classic themes only — on block/FSE themes like Twenty Twenty-Four/Twenty Twenty-Five, use the EDZNET Geo Gutenberg block or the [edznet_geo] shortcode instead.)
Does country blocking stop login attempts?
Country and continent blocking covers the front end of your site. For logins, use Login protection on the Blocking page: choose “Only allow logins from the countries below” (for example just your own country) or “Use the blocked continents and countries above”. It applies to wp-login.php, renamed login URLs, WooCommerce and other login forms that use the standard WordPress login, XML-RPC and application passwords. Blocked visitors see “Logins from your location are not allowed on this site.” whether or not their password was right.
What if I lock myself out?
The settings page will not save login rules that would block your own login, and it shows whether your current IP can log in. Whitelisted IPs can always log in, and if a location lookup fails the login is allowed. If you are ever locked out (for example while travelling), add define( 'EDZNET_GEO_LOGIN_UNLOCK', true ); to wp-config.php, log in, adjust the settings, and remove the line again.
Does it work behind Cloudflare or another proxy?
Yes. When a request comes from a Cloudflare address, the visitor’s real IP is taken from Cloudflare’s header automatically. Behind another proxy, load balancer or CDN, add its IP addresses under Trusted proxies on the Blocking page. Forwarding headers (X-Forwarded-For, X-Real-IP, CF-Connecting-IP) are only believed from Cloudflare, your own server or a trusted proxy, so they can’t be faked to get round blocking or login protection. If every visitor shows the same IP in the Visitor Log, that IP is your proxy: add it to Trusted proxies. Developers can also use the edznet_geo_visitor_ip filter.
Can I whitelist my own IP to avoid being blocked?
Yes. Add your IP to the IP Whitelist section on the Blocking page. Whitelisted IPs bypass country blocking, IP blocking, and the restricted page redirect.
Does this work with caching plugins?
Yes. The shortcode and blocking check run on standard WordPress hooks compatible with most caching setups.
Does it work on WordPress Multisite?
Yes. Network-activate it and enter one API key under Network Admin → Settings → EDZNET Geo; every site uses that key, shares one lookup cache, and the low-credit alert is sent once for the network. Each site keeps its own visitor log, blocking rules and logging/debug settings. New sites are set up automatically and their log table is removed when a site is deleted. You can also activate it on individual sites, in which case each site enters its own key as on a single install.
Can I set the API key in wp-config.php?
Yes. Add define( 'EDZNET_GEO_API_KEY', 'your-key' ); to wp-config.php and the plugin uses it instead of the key saved in the settings.
Changelog
1.6.1
- Security: country blocking, the visitor log and the location shortcodes now use the same IP check as login protection. Forwarding headers (X-Forwarded-For, X-Real-IP, CF-Connecting-IP) are only believed from Cloudflare, the server’s own proxy or a trusted proxy, so a visitor can no longer fake their IP to get round country or IP blocking.
- New: “Trusted proxies” on the Blocking page, for sites behind a proxy, load balancer or CDN other than Cloudflare. If every visitor shows the same IP in the Visitor Log after updating, add that IP there.
- New:
edznet_geo_visitor_ipfilter.
1.6.0
- New: Login protection on the Blocking page. Only allow logins from the countries you choose, or apply the site’s country and continent blocks to logins. Covers wp-login.php (including renamed login URLs), WooCommerce and other login forms, XML-RPC and application passwords; front-end country blocking never covered logins.
- New: optionally refuse the login, lost-password and registration pages themselves to visitors who can’t log in.
- Lookups for login protection only happen when someone submits a login and use the 30-day cache, with a 5-second timeout. If a lookup fails, the login is allowed.
- Safety: settings that would block your own login are not saved, the page shows whether your IP can log in, whitelisted IPs always can, and
define( 'EDZNET_GEO_LOGIN_UNLOCK', true );in wp-config.php switches login protection off. - Login protection only trusts forwarding headers from Cloudflare or a local proxy, so a faked header can’t get round it.
1.5.0
- New: WordPress Multisite support. Network-activate to share one API key, one lookup cache and one low-credit alert across all sites, set in Network Admin > Settings > EDZNET Geo. Each site keeps its own visitor log and blocking rules, new sites are set up automatically and deleted sites are cleaned up.
- New: the API key can be set in wp-config.php with define( ‘EDZNET_GEO_API_KEY’, ‘…’ ); it takes priority over a key saved on the settings page.
1.4.4
- Fix: admin notices from other plugins (for example review or upgrade prompts) were displayed inside the EDZNET Geolocation admin page header. They now appear below it.
1.4.3
- Removed: the “Link back to EDZNET & win” promotion banner on the dashboard, along with its submission endpoint. The plugin no longer contacts
edznet.io/api/geo/v1/promoor sends promotion emails, and any stored promotion data is deleted on upgrade. - New: refreshed admin UI with a consistent header, card layout, a stats overview and a “Recent activity” panel on the dashboard.
- New: the Blocking page has a country search box, a “Clear selection” button and a live count of selected countries, and warns when rules are saved but blocking is switched off.
- New: the Visitor Log has proper numbered pagination, a “Blocked” badge on blocked IPs, and CSV export respects the current action filter.
- Fix: the “Block IP” / “Unblock” links in the Visitor Log did nothing (they called the wrong AJAX action).
- Fix: the IP block/unblock AJAX handlers now check the
manage_optionscapability as well as the nonce. - Tweak: admin styles moved into an enqueued stylesheet (
css/admin.css).
1.4.2
- Tweak: bumped “Tested up to” to WordPress 7.1. No functional changes.
1.4.1
- New: all plugin CSS/JS is now loaded through
wp_enqueue_style/wp_enqueue_script(front-end geo script, admin scripts, comments screen script) instead of inline<style>/<script>tags. - New: documented the EDZNET Geo API external service in the readme, including what data is sent and links to the EDZNET Terms of Service and Privacy Policy.
- Tweak: the AJAX/REST lookup endpoint is now rate limited site-wide (60 requests/min) with no per-IP rate-limit transients written, so spoofed request-header IPs cannot create transient-table bloat.
- Tweak: the 30-day lookup cache is now capped and automatically trimmed (hourly), so spoofed request-header IPs cannot create unbounded transient-table bloat.
- Fix: remove the optional dashboard promotion banner nonce from inline markup (handled by the enqueued admin script).
1.4.0
- New: visitor log entries show the visitor’s country flag next to the logged IP.
- New: “Block IP” action on each comment row in the Comments screen for one-click moderation — click again to unblock.
1.3.0
- New fields:
continent,postal,coordinates,asn,connection,proxy,currency_symbolfor the[edznet_geo]shortcode. - Added continent blocking — block entire continents in addition to individual countries.
- Added CIDR notation support for IP blocklist and whitelist — block ranges like
192.168.0.0/16. - Added Gutenberg block — insert visitor location directly in the block editor.
- Added WordPress widget — display visitor location in any widget area.
- Added CSV export for the visitor log.
- Added client-side localStorage caching — geo-content shortcodes display instantly on repeat visits with no AJAX overhead.
- Added API rate limiting on the REST endpoint to prevent abuse.
- Continent column added to the visitor log table.
1.2.0
- Added
[edznet_geo_show country="US,CA"]shortcode — show content to specific countries. - Added
[edznet_geo_hide country="RU,CN"]shortcode — hide content from specific countries. - Both work with AJAX to survive full-page caching.
1.1.0
- Added IP blocklist: block individual IPs from the visitor log or Blocking page.
- Added IP whitelist: bypass all blocking for specific IP addresses.
1.0.0
- Initial release.