Script To Block Traffic From Outside Country

Topic summary

A user is seeking a script or solution to block website traffic originating from outside the United States.

Suggested Solutions:

  • Several Shopify apps were recommended:
    • Cozy Country Redirect
    • Traffic Police
    • GeoIP
    • Ultimate Country Blocker (includes visitor logging to monitor incoming traffic)

Custom Development Option:

  • A custom solution could be built using the ipstack.com geolocation API service with some coding work.

The discussion remains open with multiple viable options presented but no final decision indicated.

Summarized with AI on October 26. AI used: claude-sonnet-4-5-20250929.

Hi all,

Does anyone know of a Script To Block Traffic From Outside Country e.g. anything outside USA.

Thanks!

There are several apps that can be used to do this, including Cozy Country Redirect, Traffic Police, GeoIP, etc.

With some coding leveraging this service, https://ipstack.com/, a custom solution could be created too.

Cheers.

WhiteWater Web

You could try Ultimate Country Blocker. You can block any country you want from visitor your website. There is a visitor log for you to monitor incoming traffic.