Tutorial

How to block a country on Shopify (2026 guide)

Three ways to block a country on Shopify: shipping zones, Shopify Markets, and a blocking app. Which one you need depends on whether you want to stop orders or stop access. Step by step, with the free options first.

Bas Lefeber

Founder, learnshopify.dev · August 3, 2026 · 5 min read

Ready to learn Shopify development?Short, interactive lessons where you write real Liquid against a live storefront and watch it change as you type. Free, and genuinely fun.

"Block a country" turns out to mean four different things, and picking the wrong one is why merchants install an app they did not need, or install nothing and stay exposed. Two of the four are built into Shopify and cost nothing. Start there.

Answer first

If you want to stop shipping to a country: remove it from your shipping zones. If you want to stop selling to it: deactivate it in Shopify Markets. Both are free, native, and enforced at checkout. If you want to stop people from reaching the storefront at all (scrapers, fraud, bot traffic), Shopify has no native setting and you need an app.

What you wantUse thisCost
Stop shipping thereShipping zonesFree, native
Stop orders entirelyShopify MarketsFree, native
Stop them seeing the storeA blocking appFree tier available
Send them somewhere elseA blocking app with redirectFree tier available
Find your row before you do anything else.
Two of the four outcomes are free and native. Only storefront-level access needs an app.

Method 1: shipping zones (stop shipping there)

The simplest lever. If a country is not in any shipping zone, no shipping rate exists for it, and checkout cannot complete.

  1. In your Shopify admin, go to Settings then Shipping and delivery.
  2. Open the shipping profile you use (usually General shipping rates).
  3. Find the zone containing the country and remove it, or edit the zone so the country is not selected.
  4. Save, then test with a cart and that country's address at checkout.

What this does not do

Visitors from that country can still browse the whole store, add to cart, and use digital or pickup checkouts if you offer them. It only removes physical shipping. If someone is scraping your catalog, this changes nothing at all.

Method 2: Shopify Markets (stop selling there)

Markets is the native way to control which countries can actually buy from you. A country that is not in an active market cannot complete checkout, regardless of shipping setup.

  1. Go to Settings then Markets.
  2. Review which markets are active and which countries each one includes. Many stores have a broad catch-all market and never look at it again.
  3. Remove the country from its market, or deactivate the market entirely if it exists only to serve that region.
  4. Save and test. A shopper who switches to that country in your storefront picker should no longer be able to check out.

This is the right answer more often than people think

When a merchant says "block Russia," they almost always mean "stop accepting Russian orders." Markets does exactly that: deterministically, at checkout, with no code, no app, and no monthly fee. Rule it out before you install anything.

Method 3: an app (stop them reaching the store)

Neither native option stops anyone from loading your storefront. If the problem is scraping, bot traffic, fraud reconnaissance, or ad-budget waste, the damage happens on the page view itself and nothing at checkout can help. Shopify has no built-in setting for this, so an app is the only route.

Using Cordon as the example, the whole setup is three steps:

  1. Install and enable the app embed. After installing, the Setup screen walks you through it: open the theme editor, switch on the Cordon Block & Protect app embed, and save. This is what lets the app see visitors at all, so nothing works until it is on.
  2. Add a country rule. Open the Rules page and use Block by country. Search and add countries individually, or apply a preset such as Block China or Block high-risk countries. Changes stay a draft until you hit Save, so you can stage a whole policy and apply it in one go.
  3. Check the logs. The Logs page shows each visitor's country, network, and which rule fired. Watch it for a day: this is how you catch a rule that is broader than you meant.
Enable the embed, add the rule, verify in the log. The third step is the one people skip and regret.

A country rule alone is bypassed by any VPN

This is the single most important thing to understand before you rely on country blocking. Geo-IP tells you where a connection appears to come from. A visitor who installs a free VPN presents an IP somewhere else, and your rule never fires. If you are blocking a country for fraud or abuse reasons rather than policy reasons, you need VPN and proxy detection turned on beside it, or the rule is decorative. See how to block VPN traffic on Shopify.

What about the Liquid code snippets?

Search this topic and you will find blogs recommending you paste a snippet into theme.liquid that checks localization.country and redirects. Do not use it. That property is Shopify's own term for the country selected in your storefront's country picker, not the visitor's detected location. A visitor changes it in one click, the redirect runs after the page has already been delivered, and branching Liquid on a per-visitor value breaks Shopify's CDN caching so the block fires on the wrong people at random.

We took that snippet apart line by line in why localization.country is not geolocation, with the relevant Shopify documentation. The short version: it is not a weak lock, it is not a lock.

Learn this properly · free lesson

The shape of a theme: where everything lives

Knowing where theme files live makes advice like "paste this into theme.liquid" much easier to judge before you follow it. Map a real Shopify theme in your browser. Free lesson, no signup.

Try this lesson — free

Before you go live: three checks

  1. Do not block search engines. Googlebot crawls from datacenter IP ranges worldwide. Any tool you use must exempt verified crawlers by reverse DNS, not by trusting a user-agent string. Get this wrong and you deindex the store.
  2. Check your own traffic first. Look at analytics before writing rules. Blocking a country that quietly sends you 4% of revenue is an expensive way to stop a scraper.
  3. Confirm it fails open. This code runs on every page load. If the vendor's service goes down, visitors must be allowed through by default, not blocked. Ask, because not every app does this.

For a fuller merchant-side walkthrough there is a step-by-step country blocking guide, and a guide to geo-restricting a store to specific countries if your requirement is an allowlist ("only these five countries") rather than a blocklist. If you want the architecture behind all of this, the four layers you can block Shopify traffic at explains why the native options stop where they do.

Frequently asked questions

Can you block a country on Shopify without an app?

Partly. You can stop shipping to a country by removing it from your shipping zones, and stop it ordering entirely by deactivating it in Shopify Markets. Both are free and native and are enforced at checkout. What you cannot do natively is stop visitors from that country loading your storefront, because Shopify has no built-in access-blocking setting. That requires an app.

How do I block a country from ordering on Shopify?

Go to Settings then Markets and remove the country from its market, or deactivate that market. A country outside any active market cannot complete checkout. Alternatively, leave the country out of every shipping zone so no shipping rate exists for it. Markets is the cleaner option because it covers all order types rather than just physical shipping.

Does blocking a country on Shopify hurt SEO?

It can if the tool is careless. Googlebot and other search crawlers arrive from datacenter IP ranges around the world, so a blunt country or datacenter rule can block them and deindex your store. Any app you use must exempt verified crawlers by reverse DNS confirmation rather than by trusting the user-agent string, which is trivially spoofed.

Can visitors bypass Shopify country blocking with a VPN?

Yes, easily, if the rule only checks country. Geo-IP reports where a connection appears to originate, and a free VPN presents an IP in a different country, so the rule never fires. Country blocking used for fraud or abuse prevention needs VPN, proxy and Tor detection enabled alongside it to be meaningful.

Is there a Liquid code snippet to block countries on Shopify?

There are snippets circulating, and they do not work. They check localization.country, which Shopify documents as the country currently selected in the storefront picker rather than the visitor's detected location, so a visitor changes it in one click. They also redirect via JavaScript after the page is already delivered, and branching Liquid on per-visitor values breaks Shopify's CDN caching so the block fires unpredictably.

What is the best app to block countries on Shopify?

Cordon covers country blocking across 200+ countries with one-click presets, plus the IP, ASN, datacenter, VPN, proxy and Tor rules that stop a country rule being bypassed. It decides in under 50ms, fails open so an outage cannot break your store, exempts verified search crawlers, and hashes visitor IPs for privacy. Country blocking and IP rules are on its free plan.

Start free

Ready to become a Shopify developer?

You just read how it works. Now write it yourself: real tickets from a live store, in an editor where the storefront updates as you type. Module 1 is free, no card.

Start your first lesson

Free · No credit card · Your first win in minutes

ShopifysecurityMarketsThemes

About the author

Bas Lefeber, Founder, learnshopify.dev

Bas builds learnshopify.dev, where developers learn production-grade Shopify theme development against a live storefront. He writes about Liquid, theme architecture, and the parts of the job that still matter now that AI writes the code.

Keep going in the curriculum