Pro Verified

Name

Deactivate some WooCommerce Checkout Fields

About

Deactivate some WooCommerce Checkout Fields from showing

Language

Javascript

Rating

Voted: 9 by 13 user(s)

How to Setup Snippet

Add to Code Snippets to Run Everywhere. Any items that are active (and do not sit within /* and */ comments) will not be shown on the Checkout Page.

Codevault

WebSquadron

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: Not Specified

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

History

Last modified:

27/10/2023

Important Note

This snippet has the following status:

Pro Verified

This snippet has been verified by a Code Snippet Pro team member.

Pro Comments:

Deactivate some WooCommerce Checkout Fields

 
                    
1/* WooCommerce: The Code Below Removes Checkout Fields */
2add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
3function custom_override_checkout_fields( $fields ) {
4/*unset($fields['billing']['billing_first_name']);*/
5/*unset($fields['billing']['billing_last_name']);*/
6unset($fields['billing']['billing_company']);
7/*unset($fields['billing']['billing_address_1']);
8unset($fields['billing']['billing_address_2']);
9unset($fields['billing']['billing_city']);
10unset($fields['billing']['billing_postcode']);
11unset($fields['billing']['billing_country']);
12unset($fields['billing']['billing_state']);
13unset($fields['billing']['billing_phone']);*/
14unset($fields['order']['order_comments']);
15/*unset($fields['billing']['billing_email']);*/
16/*unset($fields['account']['account_username']);*/
17/*unset($fields['account']['account_password']);*/
18/*unset($fields['account']['account_password-2']);*/
19return $fields;
20}

9

Featured Snippet

Comments

  • HN

    1 year ago

    I know this comment might come as off one, but please also write how to do guide also. Might get very helpful. 

Related Snippets

Please see some snippets below related to this snippet..

WooCommerce

AI Verified

0

WooCommerce Hide Product Meta (SKU, Categories, Tags)

Added: 1 year ago

Last Updated: 1 year ago

Typically, the product’s SKU, categories and tags it belongs to, will appear under the Add To Cart call to action button. This information in known as the product meta and this guide shows you how to...

WooCommerce

AI Verified

0

WooCommerce Fixed Checkout Admin/Handling Fee

Added: 1 year ago

Last Updated: 1 year ago

A little warning, unexpected fees at checkout can put some users off and some payment gateways do not allow custom additional fees. Passing on fees and surcharges may not be legal in your location so...

WooCommerce

AI Verified

0

Change sales badge text for specific product

Added: 1 year ago

Last Updated: 1 year ago

Change the text of the sales badge on a specific product

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

Performance

AI Verified

30

Remove Unused Javascript

Added: 1 year ago

Last Updated: 1 week ago

Remove Unused Javascript - and improve your Page Speed Insight Score

WooCommerce

Pro Verified

9

Deactivate some WooCommerce Checkout Fields

Added: 1 year ago

Last Updated: 7 months ago

Deactivate some WooCommerce Checkout Fields from showing

Elementor

AI Verified

6

CSS Grid Aid

Added: 6 months ago

Last Updated: 5 days ago

This can be used for any WordPress Builder to aid working with CSS Grids.