This is a guide to show you how to hide WooCommerce product reviews by state. You will be able to hide reviews for any state in any country.
Once you apply this restriction, your customers from the restricted states won’t be able to view the product reviews on the product pages.
They will be able to change the state using a dropdown on the site’s header.
On the other hand, customers from the allowed states will be able to view the product reviews without any problems.
For this, we will use the WooCommerce Product Restrictions by State and Provinces plugin. It allows you to apply location restrictions to your products, variations, categories, and coupons with a few clicks. You can restrict content from your store by city, state, province, store location, or using any custom location.
You can download the plugin here:
Download WooCommerce Product Restrictions by Zip Code Plugin - or - Read more
Once you install the plugin, you need to follow these steps to hide the product reviews by state:
1- Set up the restriction by state on the global settings
You need to start by selecting what you want to restrict and how you want to restrict it. In this case, we will hide product reviews by state.
Go to WooCommerce > Settings > Restrictions by location.
Once there, you need to select the following values:
- I want to restrict: Product and variations
- I want to restrict by: States/provinces from one location
- Select the states where you want to hide the product reviews.
Now scroll down and select What happens when the user location is unknown. You can show or hide all the products.
Once you’re done, hit Save changes.
Important
Sometimes the states will be automatically detected, as you can see here. If the states are not automatically detected, you can add them as custom locations.
In such case, instead of restricting content by states/provinces from one location, you need to select Custom list of location and add the states manually:
2- Optional – Hide product reviews by state globally
If you want to hide product reviews from all your WooCommerce products for selected states, you need to move to the Products per location tab and select the following values:
- Products per location: Add the states here.
- Sell in selected locations: No. This is to apply the restriction, but your customers will be able to purchase the products on your store.
- What happens when a customer location is restricted: Tick the Hide product reviews checkbox.
- Save changes.
With these values, customers from restricted states won’t be able to view the product reviews on any product in your WooCommerce store.
3- Optional – Hide product reviews by state individually
If you don’t want to hide reviews from all your products, and instead restrict specific products only, you need to select these values in the Products per location tab:
- Products per location: Don’t enter any state here.
- Sell in selected locations: No. This is to apply the restriction, but your customers will be able to purchase the products on your store.
- What happens when a customer location is restricted: Tick the Hide product reviews checkbox.
- Save changes.
Now open a specific product for which you want to hide the product reviews.
Go to General under Product data.
And select the following values to hide this product’s reviews for selected states:
- Selected locations: Enter the states here.
- Available in selected locations: No.
As we explained above, we select No to apply the restriction we have configured on the plugin’s global settings. Customers will be able to purchase the products without any problem.
Once you select these values, Update the product.
Once you have updated your product and visit the store as a normal customer, you’ll see a popup asking you to select your state.
If you enter a blocked state, you won’t see the product reviews.
This is how you can easily hide the product reviews by state.
The WooCommerce Product Restrictions by State and Provinces plugin allows you to restrict products, categories, variations, and coupons by state, province, store location, city, zip code, or using any custom location.
You can download the plugin here:
Download WooCommerce Product Restrictions by Zip Code Plugin - or - Read more