How to Disable Autofocus at Checkout Field in WooCommerce?

Are you looking for a way to Disable Autofocus at Checkout Field in WooCommerce?

By Default, WooCommerce has an autofocus action to the Billing First Name field at checkout.

This means when you load the checkout page and your billing first name field is empty, it will shift the page down to focus on that field.

This behavior can be very annoying sometimes, especially if you add edit the checkout page and checkout fields and added new fields to the checkout before that one.

Okay, Enough talking

Disable Autofocus at Checkout Field in WooCommerce

You need to use the snippet below in order to disable the autofocus on checkout field:

Where to add this code?

You need to paste this code into your theme’s functions.php file. Which you can find in Dashboard >> Appearance >> Editor or You can access the file via FTP.

Just go to directory where you Install WordPress >> Wp-Content folder >> Themes >> Your active theme folder >> functions.php

Have any question? Don’t forget to leave a comment below.

If you liked this article, then please follow us on Facebook for WordPress tutorials. You can also find us on Twitter and Google.

Leave a Comment