Title: Make eircode not optional
Last modified: February 24, 2025

---

# Make eircode not optional

 *  Resolved [johnegg](https://wordpress.org/support/users/johnegg/)
 * (@johnegg)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/make-eircode-not-optional/)
 * I have added code to functions to make the Eircode (zip code) required but when
   I go to checkout it still says “optional” for eircode. Im not using any checkout
   field plugins. This is teh code im using:
 * add_filter( ‘woocommerce_checkout_fields’, ‘make_shipping_eircode_required’, 
   99 );
   function make_shipping_eircode_required( $fields ) {if ( isset( $fields[‘
   shipping’][‘shipping_eircode’] ) ) {$fields[‘shipping’][‘shipping_eircode’][‘
   required’] = true;// Optionally update the label to show it’s required.$fields[‘
   shipping’][‘shipping_eircode’][‘label’] = __( ‘Eircode *’, ‘your-text-domain’);}
   return $fields;}
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmake-eircode-not-optional%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Diego Versiani](https://wordpress.org/support/users/diegoversiani/)
 * (@diegoversiani)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/make-eircode-not-optional/#post-18325890)
 * Hi [@johnegg](https://wordpress.org/support/users/johnegg/),
 * This code seems right. I would only suggest you to change the priority so it 
   runs later in the process after other plugins might be applying their changes.
   It is usually recommended to use a priority of at least `1100` when making these
   changes to checkout fields attributes:
 *     ```wp-block-code
       add_filter( 'woocommerce_checkout_fields', 'make_shipping_eircode_required', 1100 );
       ```
   
 * If that **does not** solve the problem…
 * 1. What is the plugin you are using to add the Eircode field?
 * 2. Does this issue only happen when Fluid Checkout is activated?
 * Kind regards,
   Diego.
 *  Thread Starter [johnegg](https://wordpress.org/support/users/johnegg/)
 * (@johnegg)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/make-eircode-not-optional/#post-18327084)
 * Thanks man, actually I got it sorted using this code instead of the one ChatGPT
   gave me above! [https://stackoverflow.com/questions/62655529/make-postcode-checkout-field-required-for-ireland-in-woocommerce](https://stackoverflow.com/questions/62655529/make-postcode-checkout-field-required-for-ireland-in-woocommerce)
 * We are safe enough yet before being taken over by AI! 🙂
 *  Plugin Author [Diego Versiani](https://wordpress.org/support/users/diegoversiani/)
 * (@diegoversiani)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/make-eircode-not-optional/#post-18327237)
 * Hi [@johnegg](https://wordpress.org/support/users/johnegg/),
 * Great!
 * I’m closing this ticket for now.
 * Kind regards,
   Diego.

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

The topic ‘Make eircode not optional’ is closed to new replies.

 * ![](https://ps.w.org/fluid-checkout/assets/icon-256x256.png?rev=3492947)
 * [Fluid Checkout for WooCommerce - Lite](https://wordpress.org/plugins/fluid-checkout/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/fluid-checkout/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/fluid-checkout/)
 * [Active Topics](https://wordpress.org/support/plugin/fluid-checkout/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/fluid-checkout/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/fluid-checkout/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Diego Versiani](https://wordpress.org/support/users/diegoversiani/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/make-eircode-not-optional/#post-18327237)
 * Status: resolved