Title: Required fields shown as (optional)
Last modified: January 7, 2020

---

# Required fields shown as (optional)

 *  Resolved [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/required-fields-shown-as-optional/)
 * Hello There
 * Nice plugin but ran into a problem which i don’t have a clue about.
 * I’ve set the state (‘billing_state’) as a required field for the checkout form.
   But alas It is shown as optional in the form.
 * settings : [https://imgur.com/a/YXpnlhN](https://imgur.com/a/YXpnlhN)
    form :
   [https://imgur.com/2X3Iks3](https://imgur.com/2X3Iks3)
 * I have also included the below function in the functions.php to make it required
   but no avail.
 * `add_filter(‘woocommerce_billing_fields’, ‘custom_billing_fields’, 1000, 1);
   
   add_filter(‘woocommerce_checkout_fields’, ‘custom_billing_fields’, 1000, 1);
 * function custom_billing_fields( $fields ) {
    $fields[‘billing’][‘billing_state’][‘
   required’] = true;
 *  return $fields;
    }
 * Please help.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Frequired-fields-shown-as-optional%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [ThemeHigh](https://wordpress.org/support/users/themehigh/)
 * (@themehigh)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/required-fields-shown-as-optional/#post-12300300)
 * The required property of the State field will change according to the country
   selected.
 * You can use the below hook in your child theme’s functions.php to make the state
   field required for all the country.
 * `add_filter('thwcfd_address_field_override_required','__return_true');`
 * We hope this will help 🙂
 * Thank you!
 *  Thread Starter [Hasi Weragala](https://wordpress.org/support/users/hasinthawk/)
 * (@hasinthawk)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/required-fields-shown-as-optional/#post-12300626)
 * Works like a charm. Thanks so much mate.
 *  Plugin Author [ThemeHigh](https://wordpress.org/support/users/themehigh/)
 * (@themehigh)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/required-fields-shown-as-optional/#post-12303905)
 * Great 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Required fields shown as (optional)’ is closed to new replies.

 * ![](https://ps.w.org/woo-checkout-field-editor-pro/assets/icon-256x256.gif?rev
   =3479964)
 * [Checkout Field Editor (Checkout Manager) for WooCommerce](https://wordpress.org/plugins/woo-checkout-field-editor-pro/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-checkout-field-editor-pro/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/reviews/)

## Tags

 * [billing fields](https://wordpress.org/support/topic-tag/billing-fields/)

 * 3 replies
 * 2 participants
 * Last reply from: [ThemeHigh](https://wordpress.org/support/users/themehigh/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/required-fields-shown-as-optional/#post-12303905)
 * Status: resolved