How to Hide or Rename My Account page tab in WooCommerce

WooCommerce is now used for not only e-commerce, but it’s also now used for many things like service selling, Appointment booking. For different services selling sometimes, we need to customize my account page tab in WooCommerce. like if you not selling any virtual assets like software or music you don’t need Download Tab on the My Account page.  we can use two methods to hide or rename the My Account page tab in WooCommerce.

Method 1: By PHP Code snippet

if we want to remove any tab we need to get the tab slug. just click on the tab you want to remove and check the URL in the browser. copy last slug in the URL, checkout screenshot below:


Now we will do everything by this slug.

if you want to remove any tab copy-paste this snippet into your plugin or functions.php. and rename edit-address tab slug with your slug.

add_filter( 'woocommerce_account_menu_items', 'thedailywp_remove_address_my_account', 9999 );

function thedailywp_remove_address_my_account( $items ) {
unset( $items['edit-address'] );
return $items;
}

if you want to rename any tab just copy the below code snippet and paste it into your plugin or in
your theme functions.php. remember to replace slug with your selected slug.


add_filter( 'woocommerce_account_menu_items', 'thedailywp_rename_address_my_account', 9999 );

function thedailywp_rename_address_my_account( $items ) {
$items['edit-address'] = 'Receiving Address';
return $items;
}

Here is a full list of my account page tabs slug:

$items = array(
'dashboard' => __( 'Dashboard', 'woocommerce' ),
'orders' => __( 'Orders', 'woocommerce' ),
'downloads' => __( 'Downloads', 'woocommerce' ),
'edit-address' => _n( 'Addresses', 'Address', (int) wc_shipping_enabled(), 'woocommerce' ),
'payment-methods' => __( 'Payment methods', 'woocommerce' ),
'edit-account' => __( 'Account details', 'woocommerce' ),
'customer-logout' => __( 'Logout', 'woocommerce' ),
);

Method 2: Doing it from WooCommerce Setting
We can archive this in a more easy way, but Method 1 is for if you developing any plugin or
theme you have to use Method 1, as your user won’t need to set it in the WooCommerce setting. let’s
see how can we do that, Go to WooCommerce > Setting > Advanced. Just Scroll the
bottom you will find all tabs, just remove the account endpoint, and save. it will remove
the account tab from my account page. see below screenshot to a clear understanding.

 

Conclusion

There are a Few plugins to customize WooCommerce My Account Page, using that you can customize my account page in more advance without any coding. as well you can use these plugins pre-made my account page template. if you are a developer you can overwrite my account defaults page template with your theme.  if you need to customize the WooCommerce checkout page you follow this tutorial. Please let us know if this method still working in the comment section below.