Removing checkout fields in Woocommerce is especially useful when we are selling a digital product since we do not need a shipping address, zip code, etc...
How do we remove fields in our checkout? Although there are plugins that help us on this occasion, we are going to do it by code since we simply have to copy and paste it into the functions.php file of our template.
The code we need to add is the following:
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); function custom_override_checkout_fields( $fields ) { unset($fields['billing']['billing_first_name']); unset($fields['billing']['billing_last_name']); unset($fields['billing']['billing_company']); unset($fields['billing']['billing_address_1']); unset($fields['billing']['billing_address_2']); unset($fields['billing']['billing_city']); unset($fields['billing']['billing_postcode']); unset($fields['billing']['billing_country']); unset($fields['billing']['billing_state']); unset($fields['billing']['billing_phone']); unset($fields['order']['order_comments']); unset($fields['billing']['billing_address_2']); unset($fields['billing']['billing_postcode']); unset($fields['billing']['billing_company']); unset($fields['billing']['billing_last_name']); unset($fields['billing']['billing_email']); unset($fields['billing']['billing_city']); unset( $tabs['additional_information'] ); return $fields; } add_filter('woocommerce_enable_order_notes_field', '__return_false');
Here is the video in which I explain it in more detail:
Oscar I am developing a wp site where I include a store, toilet,,, I want to know how to place a button next to the product and that once I go to the box and not to the description,, directly to the payment box, Thank you for your time and collaboration.
Hi Sergio,
With this plugin you can send them directly to buy:
https://wordpress.org/plugins/woocommerce-direct-checkout/
I hope it works for you 😉
regards
Oscar
Hello Oscar,
I'm telling you I'm setting up a wordpress store with the aveda theme with woocommerce but what I want to sell are some photographic design videos with photoshop. For this I see too much previous information to make the purchase, I would like to be able to remove, billing information and additional information and that the section review and make the payment directly come out.
It's possible??
Thank you
Hello Laura,
Of course you can, that's precisely what I do in the video.
I'm going to send you the address of another article (from another blog of mine too) in which I explain how to make a website for selling videos in a premium area 😉
I hope you like it.
https://www.misingresospasivos.com/tutorial-para-crear-una-membresia-o-area-de-miembros-con-wordpress-y-woocommerce-video/
Oscar
regards
Hi Oscar, good afternoon, let's see if you can help me, I edited the fields of the checkout form, and now I can't find the file that takes care of this, simply what I want is to change where it says the name of the company, put ID/CIF in the form where the customer writes their data when buying...
Thanks in advance
Hi Mauri,
This plugin https://es.wordpress.org/plugins/woocommerce-checkout-manager/ allows you to change all those fields
regards
Oscar
Thank you
Great as always Óscar, we have appointments pending, I'll write to you tomorrow.
Thank you for spreading knowledge to your followers.
All the best
noah christ
Thank you Noah!!!
Anything here you have me 😉
A greeting!
Oscar
Thank you!! Very useful!
Thank you very much Paula 😉