Handling Extra Long State Field Labels

For some locales, the state field label is very long and doesn’t fit in the state field container. Example, here’s what the state field looks like with German translations:

Best option: Change the translation

The best option is probably to override the translation using your preferred translation plugin, such as LocoTranslate.

This translation comes from WooCommerce core РNOT CheckoutWC. 

Alternative options using custom code

If you would rather not mess with translations – say you don’t want to load up a translation plugin to change one string, there are alternatives. You can either change the layout of the address fields or make the state field required so that the label doesn’t include “(optional)”.

You would add one of these snippets (not both!) to WP Admin > CheckoutWC > Advanced > Scripts > PHP Snippets.