Remove Dashboard from My Account Menu
I have a detailed tutorial about my account menu in WooCommerce on my blog and there you can find a chapter about removing menu links.
But the thing is that you can not just remove any link that easy. The problems may appear if you would like to remove “Dashboard” from my account menu.
So our goal for this tutorial is not only to remove a “Dashboard” menu link but also to perform a redirect to the next menu link. It is “Orders” by default.
I hope it is crystal clear why we need a redirect. Let’s imagine a situation when a customer signs in to your WooCommerce website. What My Account page will be displayed by default? Right. Besides, wp_get_page_permalink( 'myaccount' )
is probably used in your theme files, this function also sends users to the Dashboard page! So I think it is not enough just to redirect users after signing in, we should redirect them every time they are trying to access the Dashboard.

Below is ready to use code snippet that allows to achieve that. You can insert it to your current theme functions.php
, but please be aware of theme updates and child themes.
/**
* @snippet Remove Dashboard from My Account
* @author Misha Rudrastyh
* @link https://rudrastyh.com/woocommerce/remove-dashboard-from-my-account-menu.html
*/
// remove menu link
add_filter( 'woocommerce_account_menu_items', 'misha_remove_my_account_dashboard' );
function misha_remove_my_account_dashboard( $menu_links ){
unset( $menu_links[ 'dashboard' ] );
return $menu_links;
}
// perform a redirect
add_action( 'template_redirect', 'misha_redirect_to_orders_from_dashboard' );
function misha_redirect_to_orders_from_dashboard(){
if( is_account_page() && empty( WC()->query->get_current_endpoint() ) ){
wp_safe_redirect( wc_get_account_endpoint_url( 'orders' ) );
exit;
}
}
Some notes related to the code above:
template_redirect
hook is almost always used to perform redirects, but the thing is that this hook is fired on every website page, that’s why we need conditioning inside the function.- Related to conditions it is not enough to use
is_account_page()
, because it returnstrue
on every account page, so it is easy to end up with an endless redirect. But the thing is, that the Dashboard page is the only page among the account pages which doesn’t have an endpoint, so the second condition helps us with it. - I used
wc_get_account_endpoint_url()
to get the URL of the Orders page because I think it is the most correct method. This function was described in this tutorial. You can also find other account page endpoints there.

Misha Rudrastyh
Hey guys and welcome to my website. For more than 10 years I've been doing my best to share with you some superb WordPress guides and tips for free.
Need some developer help? Contact me
thank you for your code, it is so optimized comparing to others