How to remove links from WooCommerce My Account menu?

If you have chosen WooCommerce framework, as a tool to create your online store, then you have made the right decision. With such a large community and a very user-friendly platform for non-technical persons, use of WooCommerce for an online platform is increasing day-by-day.

When creating an online store in WooCommmerce, you will find a left sidebar menu on WooCommerce My Account page. You might want to remove some unused links from WooCommerce My Account menu. Here’s a code snippet that you can use to remove unnecessary links from My Account menu. Add code beneath to function.php file of your active WordPress theme.

				
					add_filter( 'woocommerce_account_menu_items', 'remove_my_account_menu_items' );

function remove_my_account_menu_items( $items ) {
    unset( $items['dashboard'] );      // Dashboard
    unset( $items['orders'] );         // Orders
    unset( $items['downloads'] );      // Downloads
    unset( $items['edit-address'] );   // Addresses
    unset( $items['payment-methods'] ); // Payment Methods
    unset( $items['edit-account'] );   // Account details
    unset( $items['customer-logout'] ); // Logout

    return $items;
}
				
			
Share

Disclaimer: *This post may contain affiliate links. I may earn a small commission when you click on the links and buy the products with no additional cost to you. Thank you.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.