Skip to content

Use case

Geo-Blocking for Gambling and iGaming Sites

Allow the states where you hold a license, refuse the ones where you do not, and keep a log of every decision the site made.


The rules change at every state line

Online gambling in the United States is regulated state by state. Sports betting, online casino, poker, and sweepstakes each sit in a different place in a different state, and the answer changes again outside the country. An operator is licensed in specific markets. An affiliate promotes offers that are only valid in some of them. A sweepstakes site runs on rules that a few states do not accept at all.

The consequence is the same in every case. Access has to be shaped by geography that is finer than a country, which is exactly the level most tooling refuses to work at.

IP Location Block matches requests down to state and region, so the map your site enforces can match the map your license describes.

This is not legal advice. Licensing requirements, permitted markets, and what counts as adequate access control are decisions for your compliance team and your counsel. IP Location Block is a technical control you can point at whatever map they give you. It does not interpret regulation, and installing it does not make a site compliant on its own.

Country-level tools cannot express this

Why the usual firewall and CDN rules leave you with two bad options.

01

All or nothing at the border

A country rule gives you one lever for the entire United States. Pull it and your licensed markets lose access with everyone else. Leave it alone and the states you are not licensed in walk straight in.

02

Stale data at the region level

Some tools expose a region field backed by a database file you download and forget. Address ranges move between regions all the time, so an old snapshot quietly enforces a map that no longer matches reality.

03

Nothing to show afterwards

Edge rules drop traffic silently. When somebody asks what the site did and when, a counter on a dashboard is not much of an answer. You want a record tied to the requests themselves.

How state-level enforcement works

Rules are plain text, one entry per target, written in the Simple Blocking tab.

US:State:New Jersey
US:State:Pennsylvania
US:State:Michigan

Set that list as an allowlist and only those three states reach the site. Every other request, in the United States and everywhere else, is refused by default. That shape suits a licensed operator, because the permitted set is short and changes only when a license does. A blocklist inverts it and suits sites that are broadly open with a few named exclusions. Region is an alias of State, and plain country codes such as CA or DE can sit in the same list for markets you handle at the national level.

Next you decide what a refused request receives. IP Location Block can render a block page explaining that the site is unavailable in that location, redirect to a landing page, or return a bare response code. A block page tends to work best here, because a clear message beats a site that looks broken. The options are covered in the blocked response guide.

Every evaluated request lands in the validation logs, so you keep a record of what was matched, what was refused, and when. That log doubles as an audit trail and as the way you sanity check a new rule before it meets production traffic.

The same rules extend past the public pages. Per-target settings cover wp-login.php, XML-RPC, and the admin area, which is worth setting up separately. A back office rarely needs the same map as the player-facing site.

State precision needs the native provider. The plugin also supports IPInfoDB, ipinfo.io, ipapi, ipstack, the IP2Location local database, and the GeoLite2 local database, but those resolve to the country level inside IP Location Block. State, region, and city rules come from the native IP Location Block provider and its frequently updated data. Without it connected, a precision rule degrades safely to the country it names, which for compliance work is exactly the situation you want to avoid quietly. The native API starts free at 10,000 geolocation requests per month, with larger plans for production traffic.

Set it up in four steps

From a fresh install to an enforced allowlist.

  1. 01

    Install the free plugin

    Add IP Location Block from your WordPress dashboard or from WordPress.org. It runs on WordPress 6.5 or newer with PHP 8.1 or newer.

  2. 02

    Connect the native provider

    Create an account, then paste your API key into the provider settings. State and region matching switches on from there. See the connect a provider guide.

  3. 03

    Allowlist your licensed states

    In the Simple Blocking tab, enter one US:State:Name entry per licensed market and set the list to allow. Keep the list in the same place your compliance team keeps the license schedule.

  4. 04

    Set the response and watch the logs

    Pick a block page, a redirect, or a response code, then read the validation logs for a day. They will tell you quickly whether the rule is matching the traffic you expected.

Working through it for the first time? The getting started guide covers the basics, and state and region rules covers the grammar.

Questions from operators and affiliates

Should I allowlist licensed states or block the unlicensed ones?

Allowlist, in most cases. A blocklist has to be complete to be correct, so every state you forget is open by default and every regulatory change is a race to update the list. An allowlist fails the other way. Anything you have not explicitly permitted is refused, which is the direction you want a compliance control to fail in.

Does the plugin give me an audit trail?

It keeps validation logs of the requests it evaluated, along with what happened to them. That gives you a technical record of enforcement over time. Whether the record satisfies a particular regulator is a question for your compliance team. Confirm the retention and privacy handling fit your own policies before relying on it.

Does this stop a player who uses a VPN?

No, and be careful with anyone who says their product does. A VPN moves the visitor. The request really does arrive from the exit server, so the geolocation is accurate for that address even though the person is elsewhere. IP-based blocking handles ordinary traffic well and cannot see through deliberate relocation. Operators who need more typically layer identity checks and payment-side controls on top.

Can I handle non-US markets in the same setup?

Yes. Country codes and state entries share one list, so US:State:Michigan can sit next to CA or a block on a country you do not serve. Provinces and regions elsewhere use the same grammar, for example CA:State:Ontario.

Draw the map your license actually covers

Install the free plugin, connect the native provider, and start with 10,000 geolocation requests every month.