A WordPress plugin that adds country-based visibility controls to WordPress menu items.
- Show for Countries - Display menu items only for specific countries
- Hide for Countries - Hide menu items from specific countries
- Three Targeting Modes - Show/Hide (Default), Show Only, or Hide Only
- Visual Interface - Fields appear directly in the WordPress menu editor
- Automatic Caching - 24-hour cache to minimize API calls
- No API Keys Required - Uses free geolocation services (ip-api.com by default)
- Works with All Menus - Primary, footer, mobile menus, etc.
- Nested Menu Support - Hide parent items and all children are hidden too
- Download the
menu-geo-control.zipfile - Go to Plugins → Add New in WordPress admin
- Click Upload Plugin
- Choose the zip file and click Install Now
- Click Activate Plugin
- Extract the zip file
- Upload the
menu-geo-controlfolder to/wp-content/plugins/ - Go to Plugins in WordPress admin
- Activate Menu Geo Control
- Go to Settings → Menu Geo Control
- Select your preferred geolocation service
- Set a default country code for local development
- Save settings
- Go to Appearance → Menus
- Select the menu you want to edit
- Expand any menu item by clicking the dropdown arrow
- Scroll down to see the Geo Targeting section with three fields:
Enter country codes separated by commas to show the menu item ONLY for those countries.
- Example:
AU,NZ,SG - Result: Menu item only visible to Australia, New Zealand, and Singapore visitors
- Leave empty to show for all countries
Enter country codes separated by commas to hide the menu item for those countries.
- Example:
US,GB - Result: Menu item hidden from US and UK visitors
- Leave empty to not hide for any countries
- Show/Hide (Default): Both fields work together
- Show Only: Only uses "Show for Countries" field
- Hide Only: Only uses "Hide for Countries" field
- Click Save Menu
Create region-specific product menu items:
Products (Australia/NZ)
- Show for Countries:
AU,NZ - Links to:
/products-anz
Products (Southeast Asia)
- Show for Countries:
SG,MY,ID,TH - Links to:
/products-sea
Products (North America)
- Show for Countries:
US,CA - Links to:
/products-na
Result: Each visitor sees only the product menu relevant to their region.
Sydney Support
- Show for Countries:
AU - Links to:
/support/sydney
Singapore Support
- Show for Countries:
SG,MY,ID,TH - Links to:
/support/singapore
Auckland Support
- Show for Countries:
NZ - Links to:
/support/auckland
GDPR Information
- Show for Countries:
GB,DE,FR,ES,IT,NL,BE - Links to:
/gdpr-compliance
Enterprise Plans
- Hide for Countries:
CN - Links to:
/enterprise
Result: Enterprise menu item is hidden from Chinese visitors.
Pricing (AUD)
- Show for Countries:
AU,NZ - Links to:
/pricing-aud
Pricing (SGD)
- Show for Countries:
SG,MY,ID,TH - Links to:
/pricing-sgd
Pricing (USD)
- Show for Countries:
US,CA - Links to:
/pricing-usd
Use standard ISO 3166-1 alpha-2 country codes (2 letters):
- AU - Australia
- NZ - New Zealand
- SG - Singapore
- MY - Malaysia
- ID - Indonesia
- TH - Thailand
- JP - Japan
- CN - China
- IN - India
- HK - Hong Kong
- PH - Philippines
- VN - Vietnam
- KR - South Korea
- US - United States
- CA - Canada
- MX - Mexico
- BR - Brazil
- AR - Argentina
- GB - United Kingdom
- DE - Germany
- FR - France
- ES - Spain
- IT - Italy
- NL - Netherlands
- BE - Belgium
- CH - Switzerland
- AT - Austria
- SE - Sweden
See full list of country codes
When you hide a parent menu item, all of its child (sub-menu) items are automatically hidden as well. This ensures logical menu structure.
Example:
- Parent: "Solutions" (Hidden for CN)
- Child: "Cloud Hosting"
- Child: "Managed Services"
- Child: "Support"
If a Chinese visitor views the menu, neither the parent nor any of the children will appear.
The plugin supports three free geolocation services:
- Free: Yes, no API key required
- Rate Limit: 45 requests per minute
- Accuracy: Good
- Recommended for: Most use cases
- Free Tier: 1,000 requests per day
- Rate Limit: Generous
- Accuracy: Very good
- Recommended for: Higher traffic sites
- Free Tier: 50,000 requests per month
- Rate Limit: Very generous
- Accuracy: Excellent
- Recommended for: Production sites with high traffic
- Country detection results are cached for 24 hours per IP address
- Only one API call per unique visitor per day
- Minimal performance impact due to efficient caching
- Cache can be manually cleared from settings page
When developing locally (127.0.0.1 or private IP addresses), the plugin uses the default country code set in settings. This allows you to test country-specific menus during development.
- Set your default country in Settings → Menu Geo Control
- Clear the cache
- View your site to see the menu for that country
- Change default country and clear cache to test another country
- Check Settings → Menu Geo Control to see detected country
- Verify country codes are correct (2 letters, uppercase, comma-separated)
- Clear the cache from the settings page
- Make sure you saved your menu after adding geo targeting
- Check if parent menu items have conflicting settings
- Make sure the plugin is activated
- Try expanding/collapsing the menu item
- Save and refresh the Menus page
- Check browser console for JavaScript errors
- Some themes require specific menu item structures
- Test with a default WordPress theme to isolate theme issues
- Check if your theme caches menus
The plugin works with all registered menus in WordPress:
- Primary navigation
- Footer menus
- Mobile menus
- Custom menus
- Widget area menus
Each menu can have its own geo-targeting rules per menu item.
This plugin can be used alongside:
- WPBakery Geo Control - For page content geo-targeting
- Geo Content Control - For shortcode-based geo-targeting
- Other menu plugins - Compatible with most menu extensions
This plugin:
- Detects visitor country based on IP address
- Uses third-party geolocation APIs
- Caches results for 24 hours
- Does not store personal information
- Does not use cookies
Ensure your privacy policy mentions use of geolocation services.
You can use both fields together in "Show/Hide (Default)" mode:
Example: Show menu item ONLY for AU/NZ but explicitly hide for US
- Show for Countries:
AU,NZ - Hide for Countries:
US - Result: Only AU/NZ visitors see it (US already excluded but explicitly hidden as safety)
Create multiple versions of the same menu item:
- "Contact Us (Sydney)" - Show for AU
- "Contact Us (Singapore)" - Show for SG,MY,ID,TH
- "Contact Us (Auckland)" - Show for NZ
All link to different pages with regional contact info.
No Support
For WordPress menu system questions, visit WordPress documentation.
- Initial release
- Show/Hide country targeting for menu items
- Three targeting modes
- Visual interface in menu editor
- Multiple geolocation service providers
- Automatic caching
- Admin settings page
GPL v2 or later
Developed for Phantosmax infrastructure and cloud hosting services.
