How to restrict shipping options for specific states in WooCommerce

Shipping restrictions are a common requirement for WooCommerce stores that operate under carrier limitations, regulatory requirements, or product-specific delivery rules. Allowing customers to place orders for locations that cannot be serviced often results in cancellations, refunds, and unnecessary support requests.

This guide explains how to restrict shipping to specific states and military addresses in WooCommerce while providing clear feedback to customers during checkout.

Issue Background

A WooCommerce store needed to prevent orders from being placed for Alaska, Hawaii, and Armed Forces addresses (AA, AE, and AP). Although some restrictions were already in place, certain locations remained selectable during checkout, creating the risk of unfulfillable orders.

The goal was to enforce shipping restrictions while improving the checkout experience with clear messaging.

Diagnosis

Reviewing the WooCommerce configuration revealed several gaps in the existing implementation.

  • Alaska and Hawaii restrictions were partially configured.
  • Military addresses remained selectable.
  • Checkout validation did not block all restricted destinations.
  • Conditional Shipping and Payments rules required updates.
  • Customers received limited feedback when selecting unsupported locations.

A layered solution was needed to enforce restrictions both visually and at the server level.

Resolution Steps

1. Add server-side validation

Block restricted destinations during checkout processing.

add_action('woocommerce_checkout_process', 'restrict_shipping_states');
function restrict_shipping_states() {
    $restricted_states = array('AK','HI','AA','AE','AP');
}

2. Update Conditional Shipping and Payments settings

Ensure all restricted states are included in shipping rules.

3. Add customer-facing warnings

Display helpful messages when restricted states are selected.

4. Validate saved addresses

Confirm stored customer addresses cannot bypass restrictions.

5. Test checkout workflows

Verify behavior across desktop and mobile devices.

6. Deploy and monitor

Review order activity after launch to confirm proper operation.

Final Outcome

After implementing validation rules, updating Conditional Shipping and Payments settings, and adding customer-facing notifications, restricted destinations could no longer complete checkout. Customers received immediate feedback, reducing confusion and preventing invalid orders.

Organizations using WooCommerce, Conditional Shipping and Payments, custom shipping rules, and complex fulfillment requirements should regularly review destination restrictions to ensure compliance with carrier and business policies.

If you need help configuring WooCommerce shipping zones, Conditional Shipping and Payments, checkout validation, or custom fulfillment rules, contact Freshy.