---
title: "How do you add the Mexican states to WooCommerce?"
description: "Screenshot of the result of the PHP code used. After getting in touch with us so that we could help them with the configuration of our plugin WC - APG Weight Shipping for the online shop of one of their"
url: https://artprojectgroup.com/how-to-add-the-mexican-states-to-woocommerce
date: 2014-07-03
modified: 2026-10-02
author: "Art Project Group"
image: https://artprojectgroup.com/wp-content/uploads/2023/04/woocommerce-blog.webp
categories: ["Tutorials"]
tags: ["E-commerce", "functions.php", "PHP", "WooCommerce", "WordPress"]
type: post
lang: en-US
---

# How do you add the Mexican states to WooCommerce?

[![How do you add the Mexican states to WooCommerce?](https://artprojectgroup.com/wp-content/uploads/2014/07/como-anadir-los-estados-mexicanos-a-woocommerce.webp)](https://artprojectgroup.com/wp-content/uploads/2014/07/como-anadir-los-estados-mexicanos-a-woocommerce.webp)Screenshot of the result of the PHP code used

After getting in touch with us so that we could help them with the configuration of our plugin [**WC - APG Weight Shipping**](/woocommerce-plugins/wc-apg-weight-shipping) for the online shop of one of their clients located in Mexico, we suggested to Imaginawebs a couple of reference links to serve as a guide for adding the Mexican states to WooCommerce, since they do not come included by default.

No sooner said than done, they set to work and used [Wikipedia](https://en.wikipedia.org/wiki/ISO_3166-2:MX) to obtain the official ISO codes of the Mexican states.

We have fixed and improved the code for them and we are now making it public in order to share it with the Mexican WooCommerce community.

Here you have the result:

Copy to clipboardSyntax Highlighterfunction woocommerce_mexican_states( $states ) {
$states[ 'MX' ] = array(
'AG' => 'Aguascalientes',
'BC' => 'Baja California',
'BS' => 'Baja California Sur',
'CM' => 'Campeche',
'CS' => 'Chiapas',
'CH' => 'Chihuahua',
'CO' => 'Coahuila',
'CL' => 'Colima',
'DF' => 'Distrito Federal',
'DG' => 'Guanajuato',
'GT' => 'Guanajuato',
'GR' => 'Guerrero',
'HG' => 'Hidalgo',
'JC' => 'Jalisco',
'ME' => 'Estado de México',
'MN' => 'Michoacán',
'MS' => 'Morelos',
'NT' => 'Nayarit',
'NL' => 'Nuevo León',
'OC' => 'Oaxaca',
'PL' => 'Puebla',
'QO' => 'Querétaro',
'QR' => 'Quintana Roo',
'SP' => 'San Luis Potosí',
'SL' => 'Sinaloa',
'SR' => 'Sonora',
'TC' => 'Tabasco',
'TS' => 'Tamaulipas',
'TL' => 'Tlaxcala',
'VZ' => 'Veracruz',
'YN' => 'Yucatán',
'ZS' => 'Zacatecas'
);

return $states;
}
add_filter( 'woocommerce_states', 'woocommerce_mexican_states' );
As always, this PHP code must be entered in the *functions.php* file of the child theme, thanks to which you will have the complete list of the Mexican states available in your online shop under WooCommerce.

Thank you, *Paulo Lievano*, for the work done.
