Magento 2 Experts — Hyvä Theme, Tailwind CSS & SEO from a Single Source ›

Magento 2 Geo Blocking: Control Countries and IP Ranges

Magento 2 Extension Hyvä Ready Magento 2.4.x

SKU: GEOBLOCKING1

  • block, redirect or show a notice for countries and IP ranges
  • exceptions for search engine crawlers, admin and payment services
  • whitelist or blacklist mode, rules per store view
  • access log with country, rule and timestamp
Auf Lager
€99.00

Einmaliger Kauf · inkl. 12 Monate Updates · zzgl. MwSt.

No download, but personal setup

No download, but personal setup. This product is not a downloadable software package for self-installation. With your order, you commission Mironsoft to individually set up this module in your shop. We will get in touch with you within 2 business days — we'll sort out the details and payment together then.

This offer is aimed at business owners and companies running a Magento 2 shop.

6 features

Magento 2 Geo Blocking: control access by country and IP range

With the Mironsoft Magento 2 Geo Blocking you decide which visitors may open your store from which country or IP range. You can block access, redirect to another store view or domain, or show only a notice. Exceptions for search engine crawlers, the admin area and payment services keep operations safe. The check runs early in the request, and the notice appears in the Hyvä theme with Alpine.js. Magento 2 Geo Blocking is configured per store view.

Block countries

Blacklist for single countries or whitelist that admits only selected countries.

IP ranges

Single IPs and network ranges (CIDR) can be blocked or allowed in addition.

Redirect instead of block

Visitors from a country reach the matching store view, domain or a notice page.

Exceptions

Crawlers, admin paths, payment callbacks and your own IPs always stay reachable.

Notice page

Friendly text instead of an empty error page, with a correct status code and editable per language.

Log

Every hit is logged with country, rule and timestamp, without storing the full IP.

Why control access

Why shops control access by country

There are many reasons not to serve visitors from certain countries: you do not deliver there, hold no licenses for brands or content, want to fend off bot traffic from certain regions or must separate prices and ranges per market. Operators therefore look for Magento 2 Geo Blocking that does not paralyse the whole store.

A blunt block at server level easily hits search engine crawlers or payment services and then hurts ranking and revenue. Magento 2 Geo Blocking therefore works with rules and exceptions you maintain in the admin.

01Rules

Magento 2 Geo Blocking: countries and IP ranges in one rule table

Each rule links one or more countries, optionally IP ranges, and a store view to an action: block, redirect or show a notice. In whitelist mode only the named countries are allowed, in blacklist mode only the named ones are blocked. The country is determined by a local geo-IP database in MMDB format that you load; there is no external lookup per visit.

  • Whitelist or blacklist, per store view
  • Single IPs and CIDR ranges
  • Local geo-IP database, no lookup per visit
Security › Geo Blocking › Rules
Rules (sample data)
Country XYblock
Country ABredirect · store view 2
IP range 192.0.2.0/24allow
Configuration › Action
Action
show notice
HTTP status
403 (sample value)
Notice text
per store view
02Actions

Block, redirect or just show a notice

Not every hit has to mean a block. When redirecting, the visitor reaches the matching store view or domain of your store. With a notice he sees a page with your text, for example that orders from his country are not possible. The page is delivered with the matching HTTP status. A cookie option remembers the choice so the visitor is not redirected on every request.

  • Redirect to store view or domain
  • Notice page with own text per language
  • Visitor choice remembered by cookie
03Exceptions

Exceptions for crawlers, admin and payment services

So the store does not drop out of the index by accident, search engine crawlers can be exempted from rules. The admin area, maintenance and cron calls as well as callbacks from your payment services stay reachable too. You enter your own office IPs as a permanent exception. A test field in the admin shows how a given IP or country would be treated.

  • Crawler exception can be switched on and off
  • Admin, cron and payment callback paths free
  • Test field for country or IP
Configuration › Exceptions
Crawlers
allowed
Payment callbacks
allowed
Office IP
allowed (example)
Geo Blocking › Log
Last 7 days (sample data)
Blocks412
Redirects1,032
04Log

Log, privacy and evaluation for geo blocking

The log shows which rule triggered how often, broken down by country and period. Only the country and a shortened form of the IP are stored, you set the retention period, and a cron job deletes older entries. That helps to spot false positives. When blocking consumers, observe the EU rules on geo-blocking; the legal review remains with the shop operator.

  • Hits per rule, country and period
  • Shortened IP, retention adjustable
  • Automatic cleanup by cron
Use cases

Where Magento 2 Geo Blocking is used in daily business

Typical situations in which Magento 2 Geo Blocking with country-based access rules makes sense.

Delivery only to target countries

Visitors from countries without delivery see a friendly notice instead of order attempts that are cancelled later.

Market and domain separation

Visitors from Austria land on the Austrian store view, visitors from Switzerland on the matching domain.

Bot and fraud defence

Conspicuous traffic from regions without customers can be blocked without hitting crawlers and payment services.

Licence and brand rights

Content or brands that may only be sold in certain markets stay visible there.

Comparison

Magento 2 Geo Blocking: without and with the module

The difference from a blunt block at server level.

TopicWithout the moduleWith Mironsoft Geo Blocking
GranularityWhole store or nothingRules per country, IP range and store view
ActionError page onlyBlock, redirect or notice
ExceptionsCrawlers and payment services often hitTargeted exceptions in the admin
TraceabilityNo evaluationLog per rule and country
MaintenanceServer configuration by an adminRule table in the Magento admin
Setup

How we set up Magento 2 Geo Blocking for you

The process after you place your order.

1

Alignment

You tell us target countries, blocking wishes, store views and exceptions such as office IPs and payment services.

2

Installation

We install the module, load the geo-IP database and set up Magento 2 Geo Blocking for your store views.

3

Notice pages

We write the notice texts per language and define status codes and redirect targets.

4

Testing

We test Magento 2 Geo Blocking with test IPs, crawler exception, admin access and payment callbacks.

5

Handover

Your team gets an introduction to the rule table, exceptions and log.

Scope

Scope compared with shipping restrictions and payment rules

The Shipping Restrictions module by Mironsoft blocks shipping methods at checkout by product, group, country or postcode. The visitor can keep using the store. Magento 2 Geo Blocking, in contrast, controls page access itself, that is, whether someone from a country may see the store at all.

Payment method rules and general security modules stay untouched. All of them can be combined.

05How the purchase works

No download — personal setup instead

Geo Blocking is not listed here as a ready-made download file for self-installation. The purchase is a service commission: we get in touch after the purchase, install the module in your shop and agree on rules, exceptions and notice texts together with you.

Important to know

Your purchase does not include a download link. We will get in touch with you within 2 business days — we'll sort out the details and payment together then. This offer is aimed at business owners and companies running a Magento 2 shop.

FAQ

Frequently asked questions

Everything important about rules, exceptions, log and the purchase process.

How can I block certain countries in Magento 2?
With Magento 2 Geo Blocking you create a rule with the countries you want and choose the action Block. Alternatively use whitelist mode and allow only selected countries.
How can I redirect visitors by country to another store view in Magento 2?
Choose the action Redirect in the rule and the target store view or domain. The visitor's choice can be remembered by cookie.
Can I also block IP ranges?
Yes, single IPs and CIDR ranges can be blocked or explicitly allowed.
Are search engine crawlers locked out?
No, if you keep the crawler exception active. Otherwise a blocked country could affect ranking.
Do admin and payment services stay reachable?
Yes. Admin paths, cron calls and payment callbacks are exempt from the rules.
Where does the country mapping of the IP come from?
Magento 2 Geo Blocking uses a local geo-IP database that we load. There is no external lookup at every visit. Accuracy depends on the database.
Is Magento 2 Geo Blocking legally safe?
That depends on audience and purpose. For consumers in the EU, rules on geo-blocking apply; the legal review remains with the shop operator.
Does it work with Hyvä?
Yes, the notice page is built with Alpine.js in the Hyvä theme and needs no additional library.
How does the module differ from shipping restrictions?
Shipping restrictions limit shipping methods. Magento 2 Geo Blocking controls access to the store.
Can I download and install the module myself?
No. This offer is not a download product. After the purchase we install and configure the module in your shop personally.
Write Your Own Review
You're reviewing: Magento 2 Geo Blocking – Mironsoft
loader
Loading...

You submitted your review for moderation.

This form is protected by reCAPTCHA - the Google Privacy Policy and Terms of Service apply.

Magento 2 Geo Blocking – Mironsoft

Magento 2 Geo Blocking – Mironsoft

€99.00