skip to Main Content

I created the custom myaccount page for Woocommerce that you can see in the screenshot below. Now I would like to know how I can remove the Shipping Address (Verzendadres in Dutch) section. I’ve tried overwriting the myaccount.php files on the server but can’t get this to work. I am using this in combination with the Astra theme for WordPress.

Woocommerce myaccount page

Thanks in advance,

2

Answers


  1. If you are having trouble changing the theme directly in wordpress, try going into your customizer through (appearance -> customize) in the administrator dashboard, then selecting "Additional Css", then select the shipping form through css and add

    display: none; 
    

    to the shipping field

    Login or Signup to reply.
  2. You can use the woocommerce_my_account_get_addresses filter hook to hide shipping address in My account "Addresses" section, this way:

    add_filter( 'woocommerce_my_account_get_addresses', 'filter_wc_my_account_get_addresses', 10, 2 ); 
    function filter_wc_my_account_get_addresses( $adresses, $customer_id ) { 
        if( isset($adresses['shipping']) ) {
            unset($adresses['shipping']);
        }
        return $adresses; 
    }
    

    Code goes in functions.php file of your active child theme (or active theme). Tested and works.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search