Drupal Extension

Drupal GEO Website Protection

Drupal GEO Website Protection is the security module that limits access to your website from unwanted countries and IP addresses. Control who can open your website and your Drupal administration based on geographic location.

Last Update: 29 Oct 2026
Version: 1.0.3
Compatibility: Drupal 10.3+ / 11

Geographic Access Control for Drupal

The module restricts access to your Drupal website based on the country a visitor's IP address belongs to. Block whole countries on the public site, keep the administration and the login page closed to the countries your team never works from, or send visitors from a country to the right language version of your website.

Most attacks on Drupal websites target the login page. Closing the administration to countries you do not work from removes almost all brute force attempts. The check runs before Drupal builds the page, even before a cached page is served, so blocked traffic costs your server almost nothing.

Country lookups use a database stored on your own server. No visitor data is sent to any external service.

Main Features

  • Block countries on the public site. Visitors from the countries you select see a short block page instead of your website. Cached pages are protected too.
  • Protect the administration. Block every page under /admin, and the login, password reset and one-time login pages, for the countries your team never works from.
  • GEO redirects. Send visitors from a country to another page of your website or to another website, keeping the page they asked for if you want. If your URLs carry the language, such as /en/, visitors from a country can get the same page in the language you assign to that country.
  • Block and allow lists by IP address. Exact addresses, wildcards and CIDR ranges, for IPv4 and IPv6.
  • Search engines stay in. Add the address ranges of Google, Bing and other crawlers to the allow list with one click.
  • Payments and integrations keep working. Exclude pages such as payment callbacks and webhooks from filtering. The Drupal cron URL is never blocked or redirected.
  • Works behind Cloudflare and reverse proxies. The real visitor address is read only from trusted proxies, so visitors cannot fake their country.
  • Activity log and charts. See who was blocked or redirected over the last 24 hours, 7 days and 30 days.
  • Custom block page. Your logo and your own text, with a live preview.
  • Easy to set up. One page under Configuration, clear switches, and a warning before you lock yourself out.

What is new in version 1.0.3

The country list now includes every country the GeoIP database knows, among them Serbia, Montenegro, Kosovo, Saint Martin and Sint Maarten. The United Kingdom now uses its correct code GB, so it is blocked when selected; settings saved with the old code UK are converted automatically after the update.

What is new in version 1.0.2

The statistics and the latest events on the module page now read the database in a way that works the same in Drupal 10.3, 11 and the coming Drupal 12, and Drupal 11 no longer logs a deprecation notice for it.

What is new in version 1.0.1

The SiteGuarding security agent (siteguarding_tools.php) is now added to the website root only when the module is installed and the site does not have it yet. An existing file is never replaced: the agent keeps itself up to date. The Settings tab offers "Install the agent" only while the agent is missing.

What is new in version 1.0.0

Version 1.0.0 is a new module for Drupal 10.3 and later and Drupal 11, with the same features and interface as the WordPress, Joomla, OpenCart and PrestaShop editions.

The module has separate switches for the public site and the administration, a country picker with search and continents, GEO redirects, IP rules with wildcards and CIDR ranges for IPv4 and IPv6, activity charts and a live preview of the block page. Forwarded headers such as X-Forwarded-For are read only from a trusted proxy, and websites behind Cloudflare work with no setup. The check runs before Drupal's page cache, settings.php is not changed, and your settings are kept when you update the module. Settings of the Drupal 8 version are imported automatically.

Screenshots

Free vs Full Version

Feature Free Version Full Version
Site protection by country Up to 5 countries
Admin protection by country Up to 5 countries
Block and allow lists by IP address, wildcard and CIDR range
Search engine crawler ranges in one click
GEO redirects by country Up to 5 countries
Never filter selected pages (payment callbacks, webhooks)
Activity log and charts
Custom block page with your logo and text
GEO database updates By hand, once every 30 days
Remove the SiteGuarding link on the front page
Support and help Email only

Protect Your Drupal Website by Location

Download the free version to get started with geographic access control, or get the full version for unlimited countries and IP lists.

Older versions for Drupal 7 and 8

The previous modules for Drupal 7 and Drupal 8 are still available. They do not run on Drupal 9, 10 or 11.

Installation

1. Unpack drupal-geo-website-protection.zip. It contains one folder, sggeoprotection.
2. Upload that folder to the modules folder of your Drupal website (on most websites web/modules/custom/ or modules/), so that you get modules/sggeoprotection/sggeoprotection.info.yml.
3. In the administration, open Extend, tick GEO Website Protection and click Install. With Drush: drush en sggeoprotection.
4. Open Configuration > System > GEO Website Protection.

Updating from an earlier version
Replace the sggeoprotection folder with the new one and run the database updates: open /update.php or run drush updatedb. Your settings and the activity log are kept.

Updating from the Drupal 8 version
Remove the old sggeoprotection folder, upload the new one and run the database updates. The settings of the Drupal 8 version are imported; IP rules are rewritten so they keep covering the same addresses, and the module page lists every rule it changed.

Requirements
Drupal 10.3 or newer, or Drupal 11, with PHP 8.1 or newer. The module keeps its settings in a folder named sggeo inside the private files folder, or inside sites/default/files when the website has no private files folder, and protects its settings from web access. The files folder must be writable for the web server, as Drupal itself requires.

Live Chat Support
Our website uses cookies, which help us to improve our site and enables us to deliver the best possible service and customer experience. See our policy Accept