Skip to content

Instantly share code, notes, and snippets.

@ncesar
Created January 24, 2019 19:46
Show Gist options
  • Save ncesar/084ff7a72fdbcc6916f9e1cec1690bd4 to your computer and use it in GitHub Desktop.
Save ncesar/084ff7a72fdbcc6916f9e1cec1690bd4 to your computer and use it in GitHub Desktop.
Code to remove a WooCommerce menu item
add_filter ( 'woocommerce_account_menu_items', 'misha_remove_my_account_links' );
function misha_remove_my_account_links( $menu_links ){
unset( $menu_links['edit-address'] ); // Addresses
//unset( $menu_links['dashboard'] ); // Remove Dashboard
//unset( $menu_links['payment-methods'] ); // Remove Payment Methods
//unset( $menu_links['orders'] ); // Remove Orders
//unset( $menu_links['downloads'] ); // Disable Downloads
//unset( $menu_links['edit-account'] ); // Remove Account details tab
//unset( $menu_links['customer-logout'] ); // Remove Logout link
return $menu_links;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment