{"id":55036,"date":"2015-09-28T03:23:40","date_gmt":"2015-09-28T07:23:40","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=55036"},"modified":"2015-10-06T05:18:49","modified_gmt":"2015-10-06T09:18:49","slug":"woocommerce-how-to-remove-checkout-fields","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/woocommerce-how-to-remove-checkout-fields.html","title":{"rendered":"WooCommerce. How to remove checkout fields"},"content":{"rendered":"<p>This tutorial shows you how to remove checkout fields in a WooCommerce store.<\/p>\r\n\t<a href=\"http:\/\/www.youtube.com\/watch?v=e7BhTVG7BPM?width=1280&amp;height=720\" rel=\"prettyPhoto\">WooCommerce. How to remove checkout fields<\/a>\r\n\r\n<p>Default WooCommerce checkout form comes with several fields for customers to enter their billing details. But in some cases, you might want to hide some of these fields. For example, if you are selling only virtual products, you can get rid of fields like billing address:<\/p>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-1.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-1-300x169.jpg\" alt=\"WooCommerce._How_to_remove_checkout_fields-1\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-55037\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-1-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-1-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-1-1024x576.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-1.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\t<p>In order to remove checkout fields, you need to perform the following:<\/p>\r\n\r\n\t<ol>\r\n\t\t<li>\r\n\t\t\t<p>Open up the <strong>wp-content\/themes\/themeXXXXX\/includes\/custom-function.php<\/strong> file. You may need to download it to your local system if you are using FTP, or you can access the file directly through your hosting file manager.<\/p>\r\n\t\t<\/li>\r\n\r\n\t\t<li>\r\n\t\t\t<p>Scroll down to the very end of the file and add the following code there:<\/p>\r\n<pre class=\"brush:php\">\r\n&lt;?php \r\n\r\nadd_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );\r\n \r\nfunction custom_override_checkout_fields( $fields ) {\r\n\r\n    return $fields;\r\n}\r\n\r\n?&gt;\r\n<\/pre>\r\n\t\t<\/li>\r\n\r\n\t\t<li>\r\n\t\t\t<p>Choose the fields to be removed from the list below and insert the corresponding code inside the <strong>custom_override_checkout_fields<\/strong> function before the <strong>return<\/strong> statement.<\/p>\r\n<pre class=\"brush:php\">\r\nunset($fields['billing']['billing_first_name']);\r\nunset($fields['billing']['billing_last_name']);\r\nunset($fields['billing']['billing_company']);\r\nunset($fields['billing']['billing_address_1']);\r\nunset($fields['billing']['billing_address_2']);\r\nunset($fields['billing']['billing_city']);\r\nunset($fields['billing']['billing_postcode']);\r\nunset($fields['billing']['billing_country']);\r\nunset($fields['billing']['billing_state']);\r\nunset($fields['billing']['billing_phone']);\r\nunset($fields['order']['order_comments']);\r\nunset($fields['billing']['billing_email']);\r\nunset($fields['account']['account_username']);\r\nunset($fields['account']['account_password']);\r\nunset($fields['account']['account_password-2']);\r\n<\/pre>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-2.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-2-300x121.jpg\" alt=\"WooCommerce._How_to_remove_checkout_fields-2\" width=\"300\" height=\"121\" class=\"aligncenter size-medium wp-image-55038\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-2-300x121.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-2-150x61.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-2.jpg 776w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\t\t<\/li>\r\n\r\n\t\t<li>\r\n\t\t\t<p>Save the changes in the <strong>wp-content\/themes\/themeXXXXX\/includes\/custom-function.php<\/strong> file and upload it to the server. Reload the page. The fields chosen to be unset are removed from the checkout page:<\/p>\r\n\r\n<a href=\"\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-3.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-3-300x169.jpg\" alt=\"WooCommerce._How_to_remove_checkout_fields-3\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-55039\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-3-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-3-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-3-1024x576.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/09\/WooCommerce._How_to_remove_checkout_fields-3.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\t\t<\/li>\r\n\t\t\r\n\t<\/ol>\r\n\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n\r\n<a href=\"http:\/\/www.youtube.com\/watch?v=e7BhTVG7BPM?width=1280&amp;height=720\" rel=\"prettyPhoto\">WooCommerce. How to remove checkout fields<\/a>","protected":false},"excerpt":{"rendered":"<p>This tutorial shows you how to remove checkout fields in a WooCommerce store.<\/p>\n","protected":false},"author":85,"featured_media":55042,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1556],"tags":[1307,907,2418],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/55036"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/85"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=55036"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/55036\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/55042"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=55036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=55036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=55036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}