WordPress

Show Content by Country and Block Bad Visitors: The EDZNET Geolocation Plugin Explained

IP geolocation, visitor logging, country blocking, and location shortcodes for WordPress — powered by the EDZNET Geo API. Show or hide content per country, block IPs and continents, no IP retention.

3 min read EDZNET Team

Knowing where your visitors are opens up a surprising amount of power. You can show country-specific pricing or announcements, gate content by region, tailor calls to action, and — just as importantly — block hostile traffic at the door: spam registrations from specific countries, comment floods from known-abuse regions, or attackers hammering your admin from abroad.

The EDZNET Geolocation plugin bundles all of that into one free plugin, powered by the EDZNET GEO API — a per-request licensed IP-geolocation service with privacy at its core.

Show or Hide Anything by Country

Location Data Shortcode

Drop a simple shortcode into any post or page to display live geolocation data to the visitor — and phrase it however you like:

[edznet_geo fields="flag, country, city, region"]

Available fields include flag, country, city, region, postal code, latitude, longitude, timezone, currency, currency symbol, continent, ISP, ASN, connection type, and proxy status. The result renders inline as HTML, so you can style it exactly like the rest of your design.

Hello/Block Content Shortcodes

Show different content to different audiences without a single line of conditional PHP. These shortcodes are resolved via AJAX, so they survive full-page caching — a cached page still shows the correct region-specific content to each visitor:

[edznet_geo_show country="US,CA,GB"]American pricing and shipping details[/edznet_geo_show]

[edznet_geo_hide country="RU"]Emergency notices for restricted regions[/edznet_geo_hide]

Gutenberg Block and Widget

Not a shortcode person? Use the "EDZNET Geo" block in the block editor, or the "EDZNET Geolocation" widget in any widget area.

Visitor Logging and Comment Moderation

When a visitor comments, logs in, or registers, the plugin records their country — and on the Comments screen you get a country flag next to each IP address, plus a one-click "Block IP" action to permanently silence a troublesome commenter. Patterns of abuse become visible at a glance instead of hidden in raw logs.

Blocking: IPs, Countries, Continents

Blocking is layered and immediate:

  • IP blocklist — individual addresses or entire CIDR ranges (for example 185.220.101.0/24)
  • IP whitelist — bypass blocking for trusted addresses such as your own office or staff
  • Country blocking — visitors from blocked countries are redirected to a dedicated restricted page
  • Continent blocking — block an entire continent at once, checked before country rules

All blocking is off by default — the plugin records and informs, but never interferes, until you choose to turn enforcement on.

Privacy, On Purpose

  • No IP retention — the EDZNET GEO API does not store IP addresses, so the service is GDPR- and POPIA-compliant by design
  • No page-view tracking — the plugin does not build behavioural profiles; it looks up a location and moves on
  • Encrypted key at rest — your API key is encrypted on disk using WordPress's own salts, never stored in plain text
  • Thirty-day local cache — lookups are cached per IP for 30 days, minimising API calls and preserving visitor privacy

Pricing That Starts Free

The plugin itself is free. Regional lookups are processed through the EDZNET GEO API, which includes a free tier of 100 lookups per month — far more than the average site needs. Enter your API key once under EDZNET Geo → Settings and everything works automatically.

Frequently Asked Questions

Does the AJAX location lookup slow down my site?

No. Lookups are cached locally for 30 days per IP, so returning visitors are served from the plugin's own cache — the API is only contacted for a brand-new visitor.

Will the country shortcodes work if I use a page cache?

Yes. Content is resolved via AJAX after the page loads, which is exactly why the shortcodes survive full-page caching.

Does it collect personal data about visitors?

No. The plugin performs a one-off IP-to-location lookup and does not retain, profile, or transmit behavioural data. The service explicitly does not retain IP addresses.

Can I block just one IP, not a whole country?

Absolutely — add the individual address to the IP blocklist, or use a CIDR range for a small network.

Download EDZNET Geolocation Explore the EDZNET GEO API

Relevant solutions

Questions about your setup?

Talk to the people who run the servers. We'll tell you honestly what you need — and what you don't.