WordPress   

Customize My Account sidebar menu in WooCommerce

My Account sidebar menu items can be customized by the woocommerce_account_menu_items WooCommerce hook. You can reorder, change labels and disable the menu items with the help of this code snippet. In the following example, the Downloads tab is disabled and a few tabs are reordered.

// Edit My Account page sidebar menu items in  WooCommerce
add_filter( 'woocommerce_account_menu_items', 'rp_edit_my_account_sidebar_menu_woo' );
function rp_edit_my_account_sidebar_menu_woo( $menu_items ) {
	$menu_items = array(
		'dashboard'       => __( 'Dashboard', 'woocommerce' ),
		'orders'          => __( 'Orders', 'woocommerce' ),
		'edit-address'    => _n( 'Edit Address', 'Address', (int) wc_shipping_enabled(), 'woocommerce' ),
		'edit-account'    => __( 'Edit Account', 'woocommerce' ),
		//'downloads'       => __( 'Downloads', 'woocommerce' ),
		'customer-logout'       => __( 'Logout', 'woocommerce' ),
	);   
	return $menu_items;
}
Need Professional Support for Your Website Problems?

Whether you're facing website issues or struggling with code implementation, our team is here to assist. Hire us to get your website back on track.

Hire Us