GeoIP Content Switcher
GeoIP Content Switcher
Description
GeoIP Content Switcher is a professional WordPress plugin that automatically detects your visitor’s country and dynamically switches content, payments, shipping methods, and products accordingly. Perfect for international WooCommerce stores and multi-country websites.
Key Features
Automatic Country Detection
- MaxMind GeoLite2 Database integration
- Cloudflare CF-IPCountry header support
- Session caching for optimal performance
- Accurate IP-based geolocation
Subdomain Redirection
- Automatic redirect to country-specific subdomains
- Example: US visitors us.yoursite.com
- Geo-lock option to prevent manual country switching
- Seamless cross-subdomain session management
WooCommerce Integration
- Filter payment gateways by country
- Filter shipping methods by country
- Hide products or categories by country
- Full WooCommerce HPOS compatibility
Content Switching
- Country-specific homepage
- Custom header content per country
- Custom footer content per country
- Full Elementor and page builder support
Performance Optimized
- Session caching with configurable duration
- Cloudflare integration
- Compatible with WP Rocket, LiteSpeed Cache, W3 Total Cache
- Minimal server resource usage
Security Features
- Database files protected from direct access
- Input sanitization and validation
- Nonce verification for all forms
- Capability checks for admin functions
- Secure session handling
Developer Friendly
- Clean, well-documented code
- Shortcodes for displaying country info
- Hooks and filters for customization
- PSR-4 autoloading
Shortcodes
[geoip_country]– Display visitor’s country name[geoip_country format="code"]– Display country code (e.g., US, UK, IN)[geoip_ip]– Display visitor’s IP address
Requirements
- WordPress 5.8 or higher
- PHP 7.4 or higher (compatible with PHP 8.0, 8.1, 8.2, 8.3)
- WooCommerce 5.0 or higher (optional, for e-commerce features)
- MaxMind GeoLite2 Country Database (free download)
Use Cases
- International e-commerce stores
- Multi-country business websites
- Region-specific content delivery
- Localized payment and shipping options
- Country-based product catalogs
- Geo-targeted marketing campaigns
Compatibility
Themes:
* Woodmart (fully tested)
* Astra
* Divi
* Elementor
* Any WordPress theme
Cache Plugins:
* WP Rocket
* LiteSpeed Cache
* W3 Total Cache
* WP Super Cache
* Cloudflare
Page Builders:
* Elementor
* WPBakery
* Beaver Builder
* Divi Builder
Additional Information
About MaxMind GeoLite2
This plugin uses the free GeoLite2 database created by MaxMind, available from https://www.maxmind.com. The database provides country-level IP geolocation data.
Privacy Policy
This plugin:
* Detects visitor country using IP address
* Stores only country code in PHP sessions (temporary)
* Does not store IP addresses in the database
* Does not share data with third parties
* Does not use tracking cookies
Credits
- MaxMind GeoLite2: https://www.maxmind.com/
- GeoIP2 PHP Library: https://github.com/maxmind/GeoIP2-php
Developer
Developed by RAJ PATHAK
Email: Rajpathak.er@gmail.com
Support the Plugin
If you find this plugin helpful, please:
* Rate it 5 stars on WordPress.org
* Share it with others who might need it
* Report bugs or suggest features in the support forum
Technical Details
System Requirements
- WordPress 5.8+
- PHP 7.4+ (8.0, 8.1, 8.2, 8.3 supported)
- MySQL 5.6+ or MariaDB 10.0+
- WooCommerce 5.0+ (optional)
- MaxMind GeoLite2 Country Database
File Structure
/includes/– Core plugin classes/assets/– CSS and JavaScript files/database/– MaxMind database location/vendor/– Composer dependencies/languages/– Translation files
Hooks and Filters
Developers can extend the plugin using WordPress hooks and filters. Documentation available in the code comments.
License
This plugin is licensed under the GPL v2 or later.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Installation
Automatic Installation
- Log in to your WordPress admin panel
- Navigate to Plugins Add New
- Search for “GeoIP Content Switcher”
- Click “Install Now” and then “Activate”
- Follow the setup wizard to complete configuration
Manual Installation
- Download the plugin ZIP file
- Log in to your WordPress admin panel
- Navigate to Plugins Add New Upload Plugin
- Choose the ZIP file and click “Install Now”
- Click “Activate Plugin”
Post-Installation Setup
Step 1: Install MaxMind GeoLite2 Database
- Sign up for a free MaxMind account at https://www.maxmind.com/en/geolite2/signup
- Download the GeoLite2 Country database (MMDB format)
- Extract the
GeoLite2-Country.mmdbfile - Upload it to:
/wp-content/plugins/geoip-content-switcher/database/
Step 2: Configure Plugin Settings
- Go to WordPress Admin GeoIP Switcher
- Select your active countries
- Set a default fallback country
- Configure subdomain mappings (if using subdomains)
- Set up payment and shipping rules per country
- Configure product visibility rules
- Save settings
Step 3: Test the Setup
- Use a VPN or proxy to test from different countries
- Verify subdomain redirects work correctly
- Check payment and shipping methods display correctly
- Test product visibility per country
Composer Dependencies (Advanced)
If you’re installing manually and the vendor folder is missing:
- Ensure Composer is installed on your server
- Navigate to the plugin directory
- Run:
composer install --no-dev
Note: The plugin package includes all dependencies pre-installed.
Screenshots

Main settings dashboard - Configure countries and default settings

Country configuration - Select active countries and set defaults

Subdomain redirect settings - Map countries to subdomains

Payment method filtering - Choose payment gateways per country

Shipping method filtering - Select shipping methods per country

Product visibility control - Hide categories by country

Homepage switcher - Assign custom homepage per country

Header/Footer customization - Add country-specific content
Faq
Yes! The plugin works with any WordPress site. WooCommerce integration is optional and only activates if WooCommerce is installed.
You can download it for free from MaxMind:
1. Sign up at https://www.maxmind.com/en/geolite2/signup
2. Download the GeoLite2 Country database (MMDB format)
3. Place the file in the plugin’s database/ folder
No, due to MaxMind’s license terms, you must download it separately. It’s free and takes just a few minutes to set up.
Yes! It’s fully compatible with:
* WP Rocket
* LiteSpeed Cache
* W3 Total Cache
* WP Super Cache
* Cloudflare
The plugin uses session-based caching to work seamlessly with page caching.
Yes! The plugin automatically detects and uses Cloudflare’s CF-IPCountry header for faster and more accurate country detection.
Absolutely! Subdomain redirection is optional. You can use the plugin just for content switching, payment filtering, or product visibility without any subdomain setup.
Yes! Fully tested and compatible with:
* PHP 7.4
* PHP 8.0
* PHP 8.1
* PHP 8.2
* PHP 8.3
No! The plugin is highly optimized:
* Country detection is cached in sessions
* Minimal database queries
* Cloudflare integration for instant detection
* Compatible with all major caching plugins
Yes! The admin panel lets you select which payment gateways are available for each country.
Yes! You can hide entire product categories per country through the admin settings.
Yes! The plugin is fully compatible with Elementor and other page builders. You can create country-specific pages and assign them as homepages.
Yes! The plugin:
* Only stores country code in sessions (no personal data)
* Uses IP addresses only for geolocation (not stored)
* Doesn’t use cookies for tracking
* Complies with GDPR requirements
Yes! Use these shortcodes:
* [geoip_country] – Shows country name
* [geoip_country format="code"] – Shows country code
* [geoip_ip] – Shows IP address
Yes! The plugin is fully compatible with WooCommerce High-Performance Order Storage (HPOS).
Yes, but country detection won’t work on localhost (127.0.0.1). You’ll need to:
* Use a VPN to test different countries
* Deploy to a staging server
* Or manually set a test country in the code
MaxMind updates their database monthly. To update:
1. Download the latest GeoLite2 Country database
2. Replace the old GeoLite2-Country.mmdb file in the database/ folder
3. Clear your site cache
Currently, the plugin focuses on content, payments, and shipping. Currency switching is planned for a future version.
The plugin is designed for single-site installations. Multisite compatibility is not officially supported at this time.
For support, please use the WordPress.org support forum for this plugin. For priority support or custom development, contact the developer.
Reviews
Changelog
1.0.5
- Initial public release
- Country detection via MaxMind GeoLite2 database
- Cloudflare CF-IPCountry header support
- Subdomain redirection with geo-lock
- WooCommerce payment gateway filtering
- WooCommerce shipping method filtering
- Product visibility control by country
- Homepage switching per country
- Header/footer content customization
- Session-based caching
- Cache plugin compatibility
- WooCommerce HPOS compatibility
- Elementor and page builder support
- Security hardening and input validation
- Shortcodes for country display
- Cross-subdomain session handling
- Admin settings interface
- PHP 7.4 – 8.3 compatibility