| 开发者 | edznet |
|---|---|
| 更新时间 | 2026年12月3日 20:01 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.2 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
[edznet_geo] — flag, country, city, region, ISP, timezone, currency, continent, postal code, coordinates, ASN, connection type, proxy/VPN flag.[edznet_geo_show country="US,CA"] and [edznet_geo_hide country="RU,CN"].edznet-geo-show-za or edznet-geo-hide-gb-us to any section, row, column or module (Divi, Elementor, Beaver Builder, Bricks, or "Additional CSS class" in the block editor) to show or hide it by 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.
Country Classes (any page builder)
Add one of these CSS classes to a section, row, column, module or block:
edznet-geo-show-za — only visible to visitors in South Africa.edznet-geo-show-gb-ie — only visible in the UK and Ireland (join two-letter country codes with -; uk works as well as gb).edznet-geo-hide-us-ca — hidden from visitors in the US and Canada.edznet-geolocation folder to /wp-content/plugins/.Yes. It is tested with WordPress 7.2 and PHP 8.6, with debug logging on and no warnings. It still works back to WordPress 5.6 and PHP 7.4.
Visit edznet.io/api-services to sign up for a free account. The free tier includes 1,000 lookups per month, and Pro 50,000.
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.
Yes. Results are cached for 30 days per IP. Repeat visitors from the same IP use the cached result.
Yes. Enable blocking in Settings, then check the continents you want to block on the Blocking page. Continent blocking is checked before country blocking.
Yes. Enable country blocking in Settings, then select countries to block in the Blocking page.
Yes. The two plugins share their lists of trusted addresses: addresses on Security Guard's "Never lock out" list (EDZNET Guard > Firewall) are treated like this plugin's IP whitelist, so country blocking and login protection let them through, and Security Guard's firewall never locks out this plugin's whitelist. Only the lists you entered yourself are shared. With Security Guard 2.3 and EDZNET Super Cache 1.4, this plugin's IP blocklist also applies to cached pages.
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.
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.
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.
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.
Yes. Search for "EDZNET Geo" in the block inserter. It supports all the same fields as the shortcode.
Yes. In Elementor, search for the EDZNET Geo widget, and open the Advanced tab of any widget, container, section or column for EDZNET Geo visibility (show only in, or hide in, the countries you pick). In Divi, add the EDZNET Geo or EDZNET Geo Content module; to show or hide a whole section, row or other module, add a country class such as edznet-geo-show-za in its Advanced tab under CSS Class. The Divi modules are built for Divi 4 and also load in Divi 5. Country classes work in any other page builder too.
No. Each visitor is looked up once and the country is kept in their browser for a day, however many pages and elements use it. Lookups that miss the browser are also cached on your server for 30 days per IP.
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.)
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.
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.
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.
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.
Yes. The shortcode and blocking check run on standard WordPress hooks compatible with most caching setups.
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.
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.
edznet-geo-show-za, edznet-geo-hide-gb-us and so on. Elements stay visible while you edit in a page builder.edznet_geo_load_everywhere filter to turn this off.UK for the United Kingdom.edznet_geo_visitor_ip filter.define( 'EDZNET_GEO_LOGIN_UNLOCK', true ); in wp-config.php switches login protection off.edznet.io/api/geo/v1/promo or sends promotion emails, and any stored promotion data is deleted on upgrade.manage_options capability as well as the nonce.css/admin.css).wp_enqueue_style / wp_enqueue_script (front-end geo script, admin scripts, comments screen script) instead of inline <style>/<script> tags.continent, postal, coordinates, asn, connection, proxy, currency_symbol for the [edznet_geo] shortcode.192.168.0.0/16.[edznet_geo_show country="US,CA"] shortcode — show content to specific countries.[edznet_geo_hide country="RU,CN"] shortcode — hide content from specific countries.