Sometimes we need to customize my account menu on the dashboard in WooCommerce. In this tutorial, I will share a simple WordPress filters which allow you to remove the unused menus from the dashboard as per your requirement.
See the below screenshot before applying the filters.
Copy the below code and add this at the end of your functions.php file and save it. You can unset the menu items from the WooCommerce my account dashboard page.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
//Remove frontent menubar from dashboard 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'] ); // Dashboard unset( $menu_links['payment-methods'] ); // Payment Methods //unset( $menu_links['orders'] ); // Orders unset( $menu_links['downloads'] ); // Downloads //unset( $menu_links['edit-account'] ); // Account details //unset( $menu_links['customer-logout'] ); // Logout return $menu_links; } |
After applying the above code inside your functions.php file it will remove the Addresses, Payment Methods, and Downloads menus from dashboard left menu bar.
Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: woocommerce tutorial, woocommerce tutorials, wordpress tutorial, wordpress tutorial for beginner, wordpress tutorial for beginners, wordpress tutorials, wordpress woocommerce tutorial