Apps

How to Block an IP Address on Shopify and Test It

Block an IP address on Shopify with an app, test the rule from the target connection, and learn why theme JavaScript is not secure.

6 min read
How to Block an IP Address on Shopify and Test It
Table of Contents

TL;DR

Shopify has no native store-wide IP firewall. Install an IP-blocking app, add the exact address to its blocklist, activate the rule, and test from that same connection in a private window. Confirm the store remains available over mobile data. Do not rely on theme JavaScript as a security control.

To block an IP address on Shopify, install an IP-blocking app, add the exact IPv4 or IPv6 address to its blocklist, select a block message or redirect, and activate the rule. Test it from the blocked connection in a private browser window, then use mobile data to confirm other visitors can still access the store.

How do I block an IP address on Shopify?

The most workable method is a dedicated IP-blocking app because Shopify does not provide merchants with a native, store-wide IP firewall. In my experience building Shopify apps, an app is also easier to test, monitor, and reverse than custom theme code.

  1. Open Shopify admin and go to Apps > Shopify App Store.
  2. Search for IP blocker, country blocker, or fraud blocker.
  3. Install an app supporting exact IP rules. One established option is Blockify Fraud Filter, Blocker, which supports IP, country, bot, proxy, and VPN controls.
  4. Complete the app's onboarding and enable its app embed if requested. The usual path is Online Store > Themes > Customize > App embeds, followed by enabling the blocker and clicking Save.
  5. Open the app from Apps > [App name] and find its IP Blocklist, Visitor Access, or similarly named section.
  6. Enter the unwanted address exactly, such as 203.0.113.42. Do not enter a broad IP range unless you understand how many visitors it covers.
  7. Select the action for matching visitors. Depending on the app, you can show a custom access-denied message, redirect the visitor, or prevent storefront access.
  8. Save or activate the rule. Allow a few minutes for the setting, app embed, or storefront cache to update before testing.

Shopify App Store listing for an IP blocker app

Blocker interfaces vary, but the core rule normally contains an IP address, a matching action, and an enabled status. Start with one exact address rather than blocking an internet provider's entire range.

IP blocker dashboard showing visitor and fraud protection controls

How do I test the blocked IP address?

Test from the exact internet connection associated with the rule, not merely the same computer. A successful test blocks that connection while a second connection, such as cellular data, continues to load the storefront normally.

  1. While connected to the target Wi-Fi or network, open api.ipify.org and copy the displayed public IP address.
  2. Add that address to the app's blocklist and confirm the rule is Active.
  3. Open a private or incognito browser window on the same network. Visit the storefront through its public domain, not the theme editor preview.
  4. Confirm that the app displays its blocked message, closes access, or sends you to the configured redirect.
  5. Turn off Wi-Fi on a phone and visit the same URL using mobile data. The store should load because the phone now uses a different public IP.
  6. Remove your test IP immediately after verification so you do not lock your office or household out of the store.

Example IP block and whitelist settings in a Shopify security app

Residential and mobile IP addresses can change without notice. If the block works today but fails later, verify the visitor's current address before assuming the app has stopped working.

Should I block storefront access or only stop checkout?

Use a visitor-blocking app when you need to restrict storefront access. Use Shopify Fraud Control when the objective is to stop suspicious checkouts and your store uses Shopify Payments.

Method What it blocks Best use
IP-blocking app Storefront visits from matching IPs Scrapers, harassment, bots, or regional access rules
Fraud Control rule Matching checkout attempts Repeat fraudulent orders using known details
Theme JavaScript Only the rendered theme experience Not recommended for security

For checkout rules, open Apps > Fraud Control > Rules > Create rule, add an IP condition, optionally combine it with an email or ZIP code, and click Save. Review Shopify's Fraud Control documentation before activating broad rules.

Blocking an IP cannot guarantee that a fraudster will stay blocked because they can switch networks, use a VPN, or obtain a new address. For repeat order abuse, combine the rule with the steps in my customer blocking guide and review this guide to preventing Shopify chargebacks.

Should I block storefront access or only stop checkout?

Why is theme JavaScript not a secure substitute?

Theme JavaScript is client-side code, not a server-side firewall. It runs after Shopify begins serving the storefront, depends on an external IP lookup service, can be disabled or bypassed, and may expose the blocked addresses inside publicly downloadable theme code.

I would not ship a security feature that only hides the page with JavaScript. It can also add latency, fail when the lookup provider is unavailable, and leave checkout or non-theme endpoints unaffected. Use an app designed for access control, then verify exactly which storefront and checkout surfaces it covers.

Common problems

Most failures come from testing the wrong public IP, leaving an app embed disabled, or expecting one IP rule to identify a person permanently. Check these items before replacing the app.

  • The store still loads: Confirm the current public IP, enable the app embed, save the theme, and retest in a private window.
  • Legitimate customers are blocked: Remove broad IP ranges and country rules. Add trusted addresses to the app's allowlist where available.
  • The rule stopped working: The visitor probably received a new IP or changed networks. Check recent app logs and create a narrow replacement rule.
  • Your own visits distort analytics: Blocking yourself is not the best analytics fix. Follow my guide to excluding your IP from Shopify-related reporting.

Can I block a specific IP address on Shopify?

Yes. Install an IP-blocking app, enter the exact IPv4 or IPv6 address, select the blocked action, and activate the rule. Shopify has no native store-wide IP firewall in its standard admin settings.

How do I block an IP address from my Shopify website?

Go to Apps > Shopify App Store, install an IP blocker, enable its app embed if required, and add the address to its blocklist. Test from that IP before relying on the rule.

Can you block someone from your Shopify website?

You can block their current IP, but you cannot permanently identify a person by IP alone. They may regain access through mobile data, another Wi-Fi network, a proxy, or a VPN.

Is there a way to block your own IP address?

Yes. Add your current public IP to the app's blocklist for testing, verify the blocked result in a private window, and remove the rule afterward. Use analytics filters instead if you only want to exclude staff visits.

Share this article