Disable Billing First Name Autofocus at Checkout in WooCommerce

Recently WooCommerce has added an autofocus action to the Billing First Name field at checkout. This means when you load the checkout and your billing first name field is empty, it will shift the page down to focus on that field. This is not always ideal, especially if you add new fields to the checkout before that one. Here’s a snippet you can use to disable the autofocus:

You can add this using the Code Snippets plugin, or your preferred method.

It’s worth noting that this snippet simply removes an autofocus attribute from that field. If you wanted to add it to another field, just make sure the field has the attribute included, like so:


James is the founder of Iconic and an experienced WooCommerce plugin developer.


1 Comment

  1. Alvina says:

    How can I remove the fields from checkout page. I am trying to remove last name and middle name but I am having an unknown error. This is my code that I have seen here in this tutorial

    function remove_additional_information_checkout($fields){
    unset( $fields[“billing_last_name”] );
    unset( $fields[“billing_middle_name”] );
    return $fields;
    add_filter( ‘woocommerce_billing_fields’, ‘remove_additional_information_checkout’ );

    Can you please help me to resolve this issue?

Leave a Reply

Your email address will not be published. Required fields are marked *