Location Blocker
The Location Blocker lets you control store access based on visitor country and city. You can block specific locations or allow only selected locations.
Blocking Modes
The Location Blocker has two modes, selected via the Block type dropdown:
Blacklist Mode (Default)
Visitors from blocked countries and cities will not be able to access your store. All other visitors are allowed.
Use this when you want to block a few specific countries.
Whitelist Mode
Only visitors from allowed countries and cities will be able to access your store. Everyone else is blocked.
Use this when you only sell to a few countries and want to block all others.
Important: Be careful when switching to whitelist mode. If you forget to add your own country, you could block yourself from accessing your store through the storefront.
Country Blocking
To block or allow countries:
- Go to Location Blocker from your dashboard.
- Select your Block type (Blacklist or Whitelist).
- Use the country search field to find and select countries. Selected countries appear as tags that can be removed.
- Click Save.
Countries are identified by their ISO country code (e.g., US, GB, CN). You can select as many countries as needed.
City Blocking
City blocking is available on Pro plans only. Free plan users see a locked indicator with the message “Available on Pro plan.”
To block or allow cities:
- In the Location Blocker page, scroll to the City Blocker section.
- Type at least 2 characters to search for a city. The search uses similarity matching and shows the top 20 closest results.
- Select the cities you want to block or allow.
- Click Save.
City blocking follows the same Blacklist/Whitelist mode as country blocking.
Page Scope
You can choose where location blocking applies:
All Pages (Default)
Blocking applies across your entire store.
Selected Pages
Blocking applies only to specific pages you select. You can choose from:
- Pages — Shopify custom pages
- Collections — Product collections
- Products — Individual products
- Blogs — Blog posts
When using selected pages in Blacklist mode, visitors from blocked locations are only prevented from accessing the selected pages. They can still browse the rest of your store.
When using selected pages in Whitelist mode, only visitors from allowed locations can access the selected pages. The rest of your store remains accessible to everyone.
Redirect Page
You can optionally set a Redirect page — a URL where blocked visitors will be sent instead of seeing the default block page.
- Enter a full URL (e.g.,
https://example.com) or a relative path (e.g.,/pages/restricted). - If left empty, blocked visitors see the customizable block page.
- A link to Customize forbidden/block page is provided below the field to access the block page editor.
How It Works on the Storefront
- When a visitor loads your store, Kedra Shield fetches their IP data to determine their country and city.
- The visitor’s country code is compared against your configured country list.
- If city blocking is enabled (Pro plan), the visitor’s city is also checked.
- Based on your Block type:
- Blacklist: If the visitor’s location matches a blocked entry, they are blocked.
- Whitelist: If the visitor’s location does not match an allowed entry, they are blocked.
- If blocked, the visitor sees the block page overlay or is redirected to your configured URL.
If the visitor’s country or city cannot be determined, they are allowed through regardless of blocking mode (fail-open design). This applies even in whitelist mode — the app will not block a visitor whose location is unknown, to avoid accidentally blocking legitimate customers.
After Saving
After saving your settings, a notice appears:
“After saving, you may need to view the latest updates in incognito mode or clear your browser’s cache.”
This is because your browser may have cached the previous version of the page before the blocking rules took effect.
Next Steps
- IP Blocker — Block or whitelist specific IP addresses.
- VPN & Proxy Blocker — Block visitors using VPNs to bypass country blocks.
- How Blocking Works — Understand why blocked visitors still appear in analytics.