• Resolved Wanderson Silva

    (@wandersoncs)


    Hello, i need to remove the word ‘optional’ from the non-required fields in the checkout page, but don’t want to hide with css. I want to remove from the code. Which file do i find this line of code? thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Diego Versiani

    (@diegoversiani)

    Hi Wanderson,

    It is not possible to remove the text “(optional)” from the field labels when those fields are actually optional without customizing the WooCommerce function which generates the fields.

    Making this customization is not part of our plugin support, as stated on our support page.

    You can find this code in the file includes/wc-template-functions.php, function woocommerce_form_field. There is a hook at the end of that function you can use to remove it, which has the same name as the function woocommerce_form_field. This applies to most checkout fields, the state field being an exception but there could be more exceptions.

    It is also not recommended to remove it as optional fields should be marked as such, according to this research:
    https://baymard.com/blog/required-optional-form-fields

    I’m closing this ticket for now.

    Best,
    Diego.

    Thread Starter Wanderson Silva

    (@wandersoncs)

    Hi, thanks for the reply!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to remove the word ‘optional’ from checkout?’ is closed to new replies.