November 29, 2023

How to Remove the Dashboard Menu from the WooCommerce “My Account” Page and Redirect to Orders

When building a streamlined eCommerce experience with WooCommerce, one of the most overlooked optimizations is removing the default Dashboard tab from the “My Account” page. This tab typically offers very little value—it merely displays some basic links, many of which are already available in other tabs.

In this article, we’ll walk through how to:

  • Remove the Dashboard menu item from the account navigation,
  • Automatically redirect users from the Dashboard to the Orders page.

This simple tweak enhances user experience by minimizing redundant navigation and directly showing customers what they care most about—their orders.


Step 1: Remove the Dashboard Menu Item

WooCommerce provides a handy filter called woocommerce_account_menu_items that allows us to customize the account navigation menu. Here’s how you can use it to remove the “Dashboard” tab:

add_filter('woocommerce_account_menu_items', function ($menu_links) {
    unset($menu_links['dashboard']);
    return $menu_links;
});

This snippet unsets the dashboard key from the array of account menu items, effectively hiding it from view.


Step 2: Redirect Dashboard URL to Orders Page

Simply removing the Dashboard menu item isn’t enough. If your theme uses something like wc_get_page_permalink( 'myaccount' ) to link to the account page, WooCommerce will still load the Dashboard as the default tab.

To prevent users from landing on an empty or broken page, we need to add a redirect from the Dashboard to the Orders tab.

Here’s the code to do just that:

add_action('template_redirect', function () {
    if (is_account_page() && empty(WC()->query->get_current_endpoint())) {
        wp_safe_redirect(wc_get_account_endpoint_url('orders'));
        exit;
    }
});

Let’s break this down:

  • template_redirect is a WordPress hook that fires before the page is rendered.
  • is_account_page() checks if the current page is the WooCommerce account page.
  • WC()->query->get_current_endpoint() returns the endpoint (like orders, edit-account, etc.). The Dashboard page is the only one without an endpoint, so it returns an empty string.

By checking that the endpoint is empty, we can safely assume the user is on the Dashboard and redirect them to the Orders page instead.

❗ Important: Don’t skip the empty() condition check—if you do, this could cause a redirect loop on every account subpage.


Final Thoughts

With just a few lines of code, you can eliminate the underwhelming Dashboard page and provide users with a more focused, task-driven account area. Redirecting users directly to their Orders page helps reduce friction and improves the overall user experience.

Perfect for modern WooCommerce stores that want to keep things simple and efficient.