Close

Remove states Woocommerce – Code list of states in Spain

add_filter('woocommerce_states', 'ds_remove_states');
function ds_remove_states( $states ) {
unset($states['ES']['TF']);
unset($states['ES']['GC']);
unset($states['ES']['CE']);
unset($states['ES']['ML']);
unset($states['ES']['PM']);
return $states;
}

Locations list

‘C’ => __( ‘A Coruña’, ‘woocommerce’ ),
‘VI’ => __( ‘Araba/Álava’, ‘woocommerce’ ),
‘AB’ => __( ‘Albacete’, ‘woocommerce’ ),
‘A’ => __( ‘Alicante’, ‘woocommerce’ ),
‘AL’ => __( ‘Almería’, ‘woocommerce’ ),
‘O’ => __( ‘Asturias’, ‘woocommerce’ ),
‘AV’ => __( ‘Ávila’, ‘woocommerce’ ),
‘BA’ => __( ‘Badajoz’, ‘woocommerce’ ),
‘PM’ => __( ‘Baleares’, ‘woocommerce’ ),
‘B’ => __( ‘Barcelona’, ‘woocommerce’ ),
‘BU’ => __( ‘Burgos’, ‘woocommerce’ ),
‘CC’ => __( ‘Cáceres’, ‘woocommerce’ ),
‘CA’ => __( ‘Cádiz’, ‘woocommerce’ ),
‘S’ => __( ‘Cantabria’, ‘woocommerce’ ),
‘CS’ => __( ‘Castellón’, ‘woocommerce’ ),
‘CE’ => __( ‘Ceuta’, ‘woocommerce’ ),
‘CR’ => __( ‘Ciudad Real’, ‘woocommerce’ ),
‘CO’ => __( ‘Córdoba’, ‘woocommerce’ ),
‘CU’ => __( ‘Cuenca’, ‘woocommerce’ ),
‘GI’ => __( ‘Girona’, ‘woocommerce’ ),
‘GR’ => __( ‘Granada’, ‘woocommerce’ ),
‘GU’ => __( ‘Guadalajara’, ‘woocommerce’ ),
‘SS’ => __( ‘Gipuzkoa’, ‘woocommerce’ ),
‘H’ => __( ‘Huelva’, ‘woocommerce’ ),
‘HU’ => __( ‘Huesca’, ‘woocommerce’ ),
‘J’ => __( ‘Jaén’, ‘woocommerce’ ),
‘LO’ => __( ‘La Rioja’, ‘woocommerce’ ),
‘GC’ => __( ‘Las Palmas’, ‘woocommerce’ ),
‘LE’ => __( ‘León’, ‘woocommerce’ ),
‘L’ => __( ‘Lleida’, ‘woocommerce’ ),
‘LU’ => __( ‘Lugo’, ‘woocommerce’ ),
‘M’ => __( ‘Madrid’, ‘woocommerce’ ),
‘MA’ => __( ‘Málaga’, ‘woocommerce’ ),
‘ML’ => __( ‘Melilla’, ‘woocommerce’ ),
‘MU’ => __( ‘Murcia’, ‘woocommerce’ ),
‘NA’ => __( ‘Navarra’, ‘woocommerce’ ),
‘OR’ => __( ‘Ourense’, ‘woocommerce’ ),
‘P’ => __( ‘Palencia’, ‘woocommerce’ ),
‘PO’ => __( ‘Pontevedra’, ‘woocommerce’ ),
‘SA’ => __( ‘Salamanca’, ‘woocommerce’ ),
‘TF’ => __( ‘Santa Cruz de Tenerife’, ‘woocommerce’ ),
‘SG’ => __( ‘Segovia’, ‘woocommerce’ ),
‘SE’ => __( ‘Sevilla’, ‘woocommerce’ ),
‘SO’ => __( ‘Soria’, ‘woocommerce’ ),
‘T’ => __( ‘Tarragona’, ‘woocommerce’ ),
‘TE’ => __( ‘Teruel’, ‘woocommerce’ ),
‘TO’ => __( ‘Toledo’, ‘woocommerce’ ),
‘V’ => __( ‘Valencia’, ‘woocommerce’ ),
‘VA’ => __( ‘Valladolid’, ‘woocommerce’ ),
‘BI’ => __( ‘Bizkaia’, ‘woocommerce’ ),
‘ZA’ => __( ‘Zamora’, ‘woocommerce’ ),
‘Z’ => __( ‘Zaragoza’, ‘woocommerce’ )