search
Log In
Welcome to Blogiestools Ask, a blogging community where beginner and professional bloggers come to seek answers from other bloggers’ experiences.

You can ask questions related to starting a blog, monetizing a blog, marketing a blog, managing a blog, fixing a problem, the best web tech tools to use, etc.

Register or log in to ask or answer questions.

Ask a Question

1 vote
How I do remove WooCommerce Checkout fields that is billing details and order comments without a plugin.
in WordPress Problems

1 Answer

0 votes
 
Best answer

To remove WooCommerce checkout fields like billing address without a WordPress plugin, add the following code to your themes functions.php file.


/* Removes WooCommerce Billing and order comments Checkout Fields  code */

add_filter( 'woocommerce_checkout_fields' , 'custom_remove_checkout_fields_blogies' );

function custom_remove_checkout_fields_blogies( $fields ) {

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['order']['order_comments']);

return $fields;
}

15.1k points

Related questions

0 votes
1 answer
I need a code to change WooCommerce add cart button text without installing a plugin
asked Nov 8, 2021 in WordPress Problems anonymous
0 votes
1 answer
I want to modify the WooCommerce checkout loading spinner gif and use my custom icon and text
asked Nov 8, 2021 in WordPress Problems anonymous
0 votes
1 answer
I need to migrate my WordPress blog without installing backup plugins
asked Nov 15, 2021 in WordPress Problems anonymous
1 vote
1 answer
How do I add expires HTTP headers to my WordPress blog without using a plugin
asked Nov 10, 2021 in Blog Optimization anonymous
1 vote
1 answer
I want to allow guest customers to checkout in WooCommerce with specific email domains. I do not want accounts to be registered during checkout with disposable emails.
asked Nov 8, 2021 in WordPress Problems anonymous