Best Way to Remove/Disable States/Province Field for Specific Countries in Magento 1 and Magento 2

April 25, 2013 Sergei Guk Tips&Tricks
Best Way to Remove/Disable States/Province Field for Specific Countries in Magento 1 and Magento 2

The State/Province field was something that many developers struggled for years in Magento – there are countries that don’t need this feature but it’s set up in Magento that not only this field was required one, but also there was a drop-down with states/provinces/counties that was not correct/needed/actual. Although the information is very important for some countries and used for both tax and shipping calculation, but there are a lot of countries that don’t need this info at all.

In previous Magento versions (up to Magento CE 1.7) there were a lot of different ways to do the task – by editing several js/phtml files in your theme, by using the SQL query TRUNCATE TABLE directory_country_region; or by installing Magento extensions to remove the field (if you don’t have chance to update to 1.7.0.2 for some reason I’d go with this free “Remove/Disable or Change Displayed States and Regions extension” by Eltrino)

In Magento Community Edition 1.7+ Magento developers heeded the requests of users and developers and finally added the functionality to manage State/Province field from the admin area. In other words, if the State/Province is not required for any countries, now you can remove the field entirely or include it as an optional field.

From the Admin panel, go to System > Configuration. Then on the left, under General tab click on General and click on States Option.

There is a list of all countries where you can select the countries where you want the State/Province to be required.

Also there is the second setting ‘Display not required State’. If ‘Yes’ than the State/Province field will be included in all addresses as a not required field; if ‘No’ the field will be removed completely from all addresses in your store (for those countries which are unselected in the list).

Magento 2

To remove state/province field for some countries go to Admin -> Stores -> Configuration -> General -> General. Under State Options you can select countries which will require State field to be filled in and for the rest of countries you can choose to display state field or not.

Best Way to Remove Disable States Province Field for Specific Countries in Magento



5 comments

  1. This doesnt work – can u double check for me?

    On the state – i choose Taiwan – and No for the second option.

    It still shows on billing information for “State and City”

  2. Hi there,

    I have the same issue – choosing “NO” has no reaction at the frontend :(
    I am using Magento 1.9.2.0
    Please advice how to proceed.

    Best regards,
    Kalina

  3. The informations in the article is a little misleading, at least for Magento 1.
    The Region field is hard-coded in the templates. Only the combo select (that replaces the plain input field for the configured countries with required region) will be disabled by that setting. The plain input field will still remain.
    The only way to completely remove the region field from the edit forms is still by changing the template files.

  4. Dear Mihai,

    thank you for the reasonable comment! You are definitely right, the article is pretty old and today the process is a little different.

    Kindly,
    Sergej

Post a new comment

top
BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *