Skip to content

Instantly share code, notes, and snippets.

Last active Mar 31, 2016
What would you like to do?
WooCommerce: Hide the undesired service for the required Zip Codes
add_filter('woocommerce_package_rates', 'wf_remove_shipping_options_for_particular_zip_codes', 10, 2);
function wf_remove_shipping_options_for_particular_zip_codes($rates, $package)
global $woocommerce;
$excluded_zip_array = array(
if (in_array($woocommerce->customer->get_shipping_postcode() , $excluded_zip_array)) {
return $rates;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment