Discover, trust, install: FAIR 1.0 is here

Plugin Banner

Block Website Access by Region — Lite

by stupidsimpleplugins

Version: 1.0

Download
Description

Block Website Access by Region — Lite stops unwanted traffic at page load without slowing your site.

  • Remote IP lookups (ipwho.is ipapi.co ipinfo.io) with automatic failover
  • Country-level rules only—no logging, no U.S. state checks, no MaxMind DB
  • Customizable heading and body text via constants (BSAS_DEFAULT_BODY, bsas_block_heading)
  • Lightweight: one option group, no database tables, minimal transients

Need detailed logs, state-level blocking, a visual message editor, or a local GeoLite2 database? See the Pro edition.

External services

This plugin queries third-party IP geolocation APIs to detect a visitor’s country. For each request, it sends the visitor’s IP address to the provider and receives a two-letter country code and (when available) an ASN/organization string. Lite mode does not store per-visitor logs; only a short-lived transient cache of the country/ASN is kept to reduce API calls.

Providers used (in failover order), with terms and privacy:

1) IPWHOIS (endpoint: https://ipwho.is/) — Terms: https://ipwhois.io/terms — Privacy: https://ipwhois.io/privacy . :contentReference[oaicite:0]{index=0}

2) ipapi (endpoint: https://ipapi.co/) — Terms: https://ipapi.co/terms/ — Privacy: https://ipapi.co/privacy/ . :contentReference[oaicite:1]{index=1}

3) IPinfo (endpoint: https://ipinfo.io/) — Terms: https://ipinfo.io/terms-of-service — Privacy: https://ipinfo.io/privacy-policy . :contentReference[oaicite:2]{index=2}

  1. Upload the plugin folder to /wp-content/plugins/ or install through Plugins Add New Upload.
  2. Activate Block Website Access by Region — Lite.
  3. Go to Settings Block Website Access and tick the countries you wish to block.
  4. Visitors from blocked countries immediately receive a 403 page.
Does it store any visitor data?

Lite mode never writes logs; it relies on short-lived transients for geo-lookups.

Will it work behind Cloudflare or a reverse proxy?

Yes. The plugin first checks HTTP_CF_CONNECTING_IP and falls back to standard proxy headers or REMOTE_ADDR.

How accurate are the remote providers?

Typical country-level accuracy is high; Pro can use a local MaxMind GeoLite2 database to improve resilience if APIs fail.

How do I change the block-page text?

Edit the constant in the main plugin file:
define( ‘BSAS_DEFAULT_BODY’, ‘Access from {COUNTRY} is restricted.’ );

  • Version:Version: 1.0
  • Last updated:Last updated: 1 month ago
  • Requires:Requires: 5.6
  • Tested:Tested: 6.8.2
Average rating:0 out of 5 stars.
  • Number of ratings: 0 ratings
  • Number of ratings: 0 ratings
  • Number of ratings: 0 ratings
  • Number of ratings: 0 ratings
  • Number of ratings: 0 ratings
Back to top