Setting Up Redirection for Restricted Countries
To enable country based restrictions and redirections, you will firstly need a plugin, like the WooCommerce Country Restrictions. Once its installed and activated, you can restrict products, prices, cart button and redirect customers by following these steps:
Step 1: Setup Redirection for Add-to-Cart and Hidden Products (Rule Level)
Go to WooCommerce > Country Restrictions > Rules > Add New Rule. From here, go to
Restriction Mode and choose to Restrict Products or Price and Add-to-Cart. For both options, you can set redirections.
If you choose Restrict Add-to-Cart setting, you can choose the Replace with a custom button option to add a custom text and link. The link will allow you to redirect users to desired pages.
For product restrictions you can select the following options to redirect users as they try to view a restricted product:
- Restriction Message: Add a custom message to replace hidden products
- Select Store URL: Select a store page to divert users if they access the product directly
- Custom URL: Enter a website link to redirect users if they access directly
Step 2: Setup Redirection at Global Level (General Settings)
Go to WooCommerce > Country Restrictions > General Settings. From here, you will see the Restrict Add-to-Cart option. Again, choose the Replace with a custom button option to add custom text and link for redirection.
Step 3: Setup Redirection for Cart Button (Product Level)
Go to Products > choose a product and click Edit. Then go to Product Data > Country Restriction to apply restriction settings to individual products. To set redirections go to
Select a Method of Hiding Add-to-Cart and choose, Replace with a Custom Button. Here, you can add custom text and a link for redirection.