Title: Remove Fields
Last modified: June 7, 2021

---

# Remove Fields

 *  Resolved [babbancarter](https://wordpress.org/support/users/babbancarter/)
 * (@babbancarter)
 * [5 years ago](https://wordpress.org/support/topic/remove-fields-14/)
 * How can I get rid of some of the fields on the product pages on the shipping 
   calculator? For example I only ship to one country so don’t need to show the 
   country. Also, need to get rid of the state and city if I am only using table
   rates with postcodes. Ideally I just want to keep it simple with only a postcode
   field. Appreciate your input.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fremove-fields-14%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [PI Web Solution](https://wordpress.org/support/users/rajeshsingh520/)
 * (@rajeshsingh520)
 * [5 years ago](https://wordpress.org/support/topic/remove-fields-14/#post-14526624)
 * Hi,
 * You can use this filter function to hide the different field
    you have to insert
   this code function in your the theme functions.php file
 *     ```
       /** to hide country */
       add_filter( 'woocommerce_shipping_calculator_enable_country', '__return_false' );
   
       /** to hide state */
       add_filter( 'woocommerce_shipping_calculator_enable_state', '__return_false' );
   
       /** to hide city */
       add_filter( 'woocommerce_shipping_calculator_enable_city', '__return_false' );
   
       /** to hide post code */
       add_filter( 'woocommerce_shipping_calculator_enable_postcode', '__return_false' );
       ```
   
 *  Thread Starter [babbancarter](https://wordpress.org/support/users/babbancarter/)
 * (@babbancarter)
 * [5 years ago](https://wordpress.org/support/topic/remove-fields-14/#post-14530734)
 * Hi rajeshsingh520,
 * Thanks for your reply. I apologize as I am new to this.
 * Unfortunately, after hiding the fields i’m not getting the correct output of 
   the shipping cost. Im using the Flexible Shipping plugin by WP Desk to calculate
   the cost using the states as zones. Unfortunately, after I hide the fields, it
   is not bypassing those fields in the background.
 * Are you please able to suggest a way to make this work?
 * Thank You!
 *  Plugin Author [PI Web Solution](https://wordpress.org/support/users/rajeshsingh520/)
 * (@rajeshsingh520)
 * [5 years ago](https://wordpress.org/support/topic/remove-fields-14/#post-14530745)
 * Hi,
 * Sorry we cant get it to work like that
 * if your shipping zones are based on state then you cant hide those field as WooCommerce
   will need those field to decide the zone and show shipping method as per that
   zone
 * that is the reason we have not given the option of hiding the field in the plugin
   as every one have different setup for shipping zones
 *  Thread Starter [babbancarter](https://wordpress.org/support/users/babbancarter/)
 * (@babbancarter)
 * [5 years ago](https://wordpress.org/support/topic/remove-fields-14/#post-14530874)
 * Thanks for your quick reply mate. I know its not your job but any chance you 
   could give me some pointers on how to achieve this? I have already tried to change
   the zones to postcodes only but I still cant make it work with the fields hidden.
   Seems like it still needs to pick the state from the dropdown and have the country
   selected even though i have only AUSTRALIA set as the country I specifically 
   sell to and ship to the countries i sell to.
 * Is there a way I can get in touch with you directly?
 *  Plugin Author [PI Web Solution](https://wordpress.org/support/users/rajeshsingh520/)
 * (@rajeshsingh520)
 * [5 years ago](https://wordpress.org/support/topic/remove-fields-14/#post-14531001)
 * Hi,
 * WooCommerce do not go ahead with post code based zone matching until there is
   Country and state information given
 * you can use the below solution to hide the Country and City field but state and
   post code will be required
 * /**
    This code will auto set Australia in your customer country */
 *     ```
       add_action( 'woocommerce_init',  'startSession_202106' );
       function startSession_202106(){
       	if(function_exists('WC') && isset(WC()->session)){
       		if ( !is_admin() && !WC()->session->has_session() ) {
       			WC()->session->set_customer_session_cookie( true );
       			WC()->customer->set_country("AU");
       		}
       	}
       }
       ```
   
 *  /**
    you can use below css code to hide the country fiend as that is auto set
   to Australia */
 *     ```
       #calc_shipping_country{
       display:none;
       }
       ```
   
 * /**
    use below code to hide the city field */
 *     ```
       add_filter( 'woocommerce_shipping_calculator_enable_city', '__return_false' );
       ```
   
 *  Thread Starter [babbancarter](https://wordpress.org/support/users/babbancarter/)
 * (@babbancarter)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/remove-fields-14/#post-14561174)
 * Thank you for your help!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Remove Fields’ is closed to new replies.

 * ![](https://ps.w.org/product-page-shipping-calculator-for-woocommerce/assets/
   icon.svg?rev=2543155)
 * [Product page shipping calculator for WooCommerce](https://wordpress.org/plugins/product-page-shipping-calculator-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/product-page-shipping-calculator-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/product-page-shipping-calculator-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/product-page-shipping-calculator-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/product-page-shipping-calculator-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/product-page-shipping-calculator-for-woocommerce/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [babbancarter](https://wordpress.org/support/users/babbancarter/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/remove-fields-14/#post-14561174)
 * Status: resolved