WooCommerce – How to Restrict Products by Zip Code

In this tutorial, we show you how to restrict products by zip code in WoCommerce. You can restrict specific products or restrict access to the shop catalog by zip code or pin code.

This way you can not only select general shipping settings, but you can also restrict access to products to users from a specific zip code.

We’ll do it without programming anything with the WordPress Conditional Post Restrictions plugin.

Once you install the plugin, follow the steps in the sections below to restrict individual products, product categories, or all products by zip code.

1- Restrict individual WooCommerce products by zip code

First, we’ll show you how to restrict individual products by billing or shipping zip code. This method is perfect when you don’t want to restrict hundreds of products because you can easily apply this conditional restriction to a few products.

Follow these steps to restrict individual products by zip code:

  1. Go to Products > All Products in wp-admin.
  2. Open the product you want to restrict by zip code.

restrict products by zip code woocommerce

Once you open your product, you need to scroll down to the Restriction rules section in the product editor and select the following values to restrict your products by billing or shipping zip code:

restrict products by zip code woocommerce

  • Enable content restrictions: Yes
  • What happens when the conditions are met: Restrict access
  • Condition 1: Billing zipcode = 90278
  • Update the product to save the changes.

Important

  • You can select billing zipcode or shipping zip code. In the screenshot, we have added billing and a shipping zip code to show you you can select any or both options.
  • If you want to add several zip codes, you can click Add ‘Or’ group to add a condition for every new zip code.

2- Restrict an entire category by zip code

Besides being able to restrict several individual products by shipping or billing zip code, you can restrict an entire product category. This is really useful because you don’t need to apply the restrictions to hundreds of products individually; instead, you can create a category and restrict it.

Just follow these simple steps to restrict an entire category by zip code:

  1. Go to Products > Categories in wp-admin.
  2. Open a category you want to edit.

restrict products by zip code woocommerce

Once you open the category you’ll restrict by zip code, select these values in the category editor:

restrict products by zip code woocommerce

  • Enable the conditional restrictions: Yes
  • Apply restrictions to: Category and posts
  • What happens when the conditions are met: Restrict access
  • Condition 1: Billing zipcode = 90278
  • Update the category to save the changes.

Important

  • You can select billing zipcode or shipping zip code. In the screenshot, we have added billing and a shipping zip code to show you you can select any or both options.
  • If you want to add several zip codes, you can click Add ‘Or’ group to add a condition for every new zip code.

3- Restrict all WooCommerce products by zip code

If you want to definitely restrict all your products by shipping or billing zip code, you don’t have to edit them individually nor edit each category. Instead, you can apply a global restriction to all your products.

Just follow these simple steps to restrict all your WooCommerce products by zip code:

  1. Go to Settings > Post Restrictions in wp-admin.
  2. Tick the Enable restrictions checkbox.
  3. Click Add conditions to create a new condition.

restrict products by zip code woocommerce

Now you need to select the following values to restrict all your WooCommerce products by billing or shipping zip code:

restrict products by zip code woocommerce

  • Enter the condition title.
  • Select post types: Products
  • What happens when the conditions are met: Restrict access
  • Condition 1: Billing zipcode = 90278
  • Publish the condition.

Important

  • You can select billing zipcode or shipping zip code. In the screenshot, we have added billing and a shipping zip code to show you you can select any or both options.
  • If you want to add several zip codes, you can click Add ‘Or’ group to add a condition for every new zip code.

What happens when the conditions aren’t met?

You can easily select what happens when users from the selected zip codes try to access the restricted products. You need to follow these simple steps:

  • Go to Settings > Post restrictions.

Once there, you’ll see these fields and options:

restrict products by zip code woocommerce

  • You have these options when the products are restricted:
    • Redirect to URL
    • Remove the content and show a message
    • Show fragment of the content and show message after fragment
  • You have these options when the categories are restricted:
    • Show error 404
    • Show the normal page without posts
    • Show an error message
    • Redirect to another URL
    • Show the content of another page

Once you select the global settings, just save the changes.

Restricting your WooCommerce products by zip code is really simple!

As you see, the WordPress Conditional Post Restrictions plugin gives you the easiest way to restrict your WooCommerce products by billing or shipping zip code. You don’t need any programming or coding knowledge nor spend great amounts of money hiring a professional programmer.

With this plugin, you get hundreds of conditional restrictions for your posts, pages, products, courses, events, recipes, downloads, forums, and any other custom post type created by WordPress plugins.

Close Menu