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: