A WordPress plugin that filters form submissions based on IP geolocation with a focus on GDPR compliance. This plugin helps businesses prevent data collection from regions they don't serve, implementing privacy-by-design principles.
- Allow-list and block-list functionality for flexible country filtering
- Real-time location checking without page refreshes
- Enhanced cloud provider detection - Supports 7 major cloud providers (AWS, GCP, Azure, DigitalOcean, Linode, Vultr, Oracle Cloud)
- Advanced email pattern filtering - Block submissions based on email regex patterns
- Privacy-by-design - IP addresses are checked and immediately discarded
- No data logging by default (optional analytics with country codes only)
- Automatic privacy policy integration
- Data export/erasure tool support
- Contact Form 7 - Native integration with custom form tags
- Gravity Forms - Complete integration with custom fields and form settings
- WPForms - Silent filtering with entry deletion and notification blocking
- Ninja Forms - Complete silent filtering with action filtering
- Forminator - Pre-submission checking with email blocking and entry deletion
- Extensible architecture for additional form builder support
- Comprehensive admin interface with tabbed settings (General, Database, Integrations, Country Settings, Advanced Filters)
- Country selector with all 249 countries/territories and search functionality
- Automatic database updates from ip-location-db (weekly)
- Enhanced cloud provider data from community GitHub sources (lord-alfred/ipranges)
- Manual database controls with bundled data import
- Activity logging with CSV export and GDPR compliance
- Go to Plugins > Add New
- Search for "Form GeoGuard"
- Install and activate the plugin
- Go to Settings > Form GeoGuard to configure
- Download the plugin zip file
- Upload to
/wp-content/plugins/directory - Activate the plugin through the WordPress 'Plugins' menu
- Configure settings at Settings > Form GeoGuard
cd /path/to/wordpress/wp-content/plugins/
git clone https://github.com/supersoju/form-geoguard.git- Go to Settings > Form GeoGuard
- Choose Allow List (only selected countries) or Block List (block selected countries)
- Select your target countries
Option A: Automatic (Recommended)
- Enable "Contact Form 7" in plugin settings to protect all CF7 forms
Option B: Manual
- Add
[geoguard geoguard-field]to specific Contact Form 7 forms
Option A: Form Settings
- Edit any Gravity Form → Form Settings
- Enable "GeoGuard Protection"
Option B: Field Method
- Add "GeoGuard" field from Advanced Fields section
Option C: Global
- Enable "Gravity Forms" in plugin settings for automatic protection
- Enable "WPForms" in plugin settings for automatic protection of all forms
- Silent filtering with automatic entry deletion for blocked submissions
- Enable "Ninja Forms" in plugin settings for automatic protection of all forms
- Complete silent filtering with action filtering and success message illusion
- Enable "Forminator" in plugin settings for automatic protection of all forms
- Pre-submission geolocation checking with email blocking and entry deletion
- The plugin automatically updates the IP database weekly
- Manual update available in Settings > Form GeoGuard > Database
- Filter Mode: Allow List or Block List
- Analytics: Optional logging of blocked attempts (country codes only)
- Allow List: Only permit submissions from selected countries
- Block List: Block submissions from selected countries
- Select/Deselect All buttons for easy management
- Automatic Updates: Weekly updates from ip-location-db
- Manual Controls: Update or clear database on demand
- Statistics: View database status and country coverage
- Contact Form 7: Enable/disable CF7 integration
- Gravity Forms: Enable/disable GF integration
- WPForms: Enable/disable WPForms integration
- Ninja Forms: Enable/disable Ninja Forms integration
- Forminator: Enable/disable Forminator integration
- Status Indicators: See which form builders are active
- WordPress: 5.8 or higher
- PHP: 7.4 or higher
- Form Builders: Contact Form 7, Gravity Forms, WPForms, Ninja Forms, Forminator (all optional)
- Geolocation: ip-location-db (free, GitHub-based)
- Cloud Providers: lord-alfred/ipranges (community-maintained)
- Coverage: 1,240+ cloud provider IP ranges across 7 major providers
- Supports both IPv4 and IPv6 addresses
- No API keys or external services required
- Database optimization: Indexed IP range queries
- Minimal overhead: AJAX requests only when needed
- Cache compatibility: Works with all major caching plugins
- No IP logging: IP addresses are never stored
- GDPR compliant: Privacy-by-design implementation
- Security headers: Proper nonce verification
- Input validation: All user inputs sanitized
form-geoguard/
├── form-geoguard.php # Main plugin file
├── includes/
│ ├── class-form-geoguard.php # Core plugin class
│ ├── class-geo-detector.php # IP geolocation detection
│ ├── class-admin-interface.php # Admin interface
│ ├── class-logger.php # GDPR-compliant activity logging
│ ├── class-utils.php # Shared utilities
│ ├── class-database-importer.php # Database import handler
│ ├── class-email-filter.php # Email pattern filtering
│ └── integrations/
│ ├── class-cf7-integration.php # Contact Form 7 integration
│ ├── class-gravityforms-integration.php # Gravity Forms integration
│ ├── class-wpforms-integration.php # WPForms integration
│ ├── class-ninjaforms-integration.php # Ninja Forms integration
│ └── class-forminator-integration.php # Forminator integration
├── data/ # Bundled IP databases (in releases)
│ ├── geo-ipv4.csv # IPv4 geolocation data
│ ├── geo-ipv6.csv # IPv6 geolocation data
│ ├── aws-ranges.json # AWS IP ranges
│ ├── gcp-ranges.json # Google Cloud IP ranges
│ ├── enhanced-cloud-ranges.json # Additional cloud providers (DigitalOcean, Linode, etc.)
│ └── database-info.txt # Metadata (download time, source)
├── scripts/
│ ├── download-enhanced-cloud-data.php # Enhanced cloud provider data downloader
│ ├── download-standalone.php # Standalone database downloader
│ ├── download-bundled-data.php # WordPress-integrated downloader
│ └── download-data.sh # Shell wrapper script
├── assets/
│ ├── js/
│ │ ├── frontend.js # Main frontend JavaScript
│ │ ├── cf7-integration.js # CF7-specific JavaScript
│ │ └── gravityforms-integration.js # GF-specific JavaScript
│ └── css/
│ └── admin.css # Admin interface styles
└── languages/ # Translation files
form_geoguard_ip_checked- Fired after IP geolocation checkform_geoguard_cf7_blocked- Contact Form 7 submission blockedform_geoguard_gf_blocked- Gravity Forms submission blockedform_geoguard_wpforms_blocked- WPForms submission blockedform_geoguard_ninjaforms_blocked- Ninja Forms submission blockedform_geoguard_forminator_blocked- Forminator submission blocked
form_geoguard_cf7_always_check- Force checking for all CF7 formsform_geoguard_gf_always_check- Force checking for all GF formsform_geoguard_wpforms_always_check- Force checking for all WPFormsform_geoguard_ninjaforms_always_check- Force checking for all Ninja Formsform_geoguard_forminator_always_check- Force checking for all Forminator formsform_geoguard_log_retention_days- Modify log retention period
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the GPL v2 or later - see the LICENSE file for details.
- ip-location-db for providing free IP geolocation data
- WordPress community for excellent plugin development resources
- Contact Form 7, Gravity Forms, WPForms, Ninja Forms, and Forminator teams for extensible form builders
Form GeoGuard - Protect your forms with geolocation filtering while respecting user privacy.