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 a helping hand in fixing your website issues?

If you are facing any problems in implementing these code snippets and tutorials, you can hire us to fix your website issues.

Hire Us