How to rename, remove, reorder and add Woocommerce My Account tabs?

In this video I’m going to show you how to add Woocommerce my account tabs. Also, I’m going to show you how to remove, rename and reorder them with the couple of clicks. So, if you’re ready then jump in.

NB! In order to use all those snippets shown in this post you need add them inside your child theme’s functions.php file or better yet, use Code Snippets plugin. This way you’re not going to lose these modifications in case you’re switching your theme.

Video: How to add, rename, remove and reorder Woocommerce My Account tabs?

Please take a look at the video here below because this way it will be much easier for you to understand how to accomplish all that and add Woocommerce my account tabs..

How to add Woocommerce My Account tabs?

It’s time to take a closer look on how to add Woocommerce My Account tabs. I’m going to show you to example. With the first of them we’ll add a support tab and with the other one we will merge Learndash profile into Woocommerce my account. (see the screenshot below).

How to add Woocommerce My Account tabs?

So, go to Snippets >> Add new and give the snippet a title. Fo example “Support tab”. Next, paste this code snippet inside the code box. Pay attention that there is a shortcode and content inside Step 4, so don’t forget to change it accordingly.

// Add Woocommerce My Account tab for Support
// 1. Register new customer-support endpoint (URL) for My Account page
add_action( 'init', 'add_support_endpoint' );
function add_support_endpoint() {
    add_rewrite_endpoint( 'customer-support', EP_ROOT | EP_PAGES );
}
  
// 2. Add new query var
add_filter( 'query_vars', 'support_query_vars', 0 );  
function support_query_vars( $vars ) {
    $vars[] = 'customer-support';
    return $vars;
}
  
// 3. Insert the new endpoint into the My Account menu
add_filter( 'woocommerce_account_menu_items', 'add_new_support_tab' );
function add_new_support_tab( $items ) {
    $items['customer-support'] = 'Support';
    return $items;
}
  
// 4. Add content to the added tab
add_action( 'woocommerce_account_customer-support_endpoint', 'support_tab_content' ); // Note: add_action must follow 'woocommerce_account_{your-endpoint-slug}_endpoint' format

function support_tab_content() {
   echo '<h4><strong>Support</strong></h4>
   <p>Fermentum tristique non imperdiet vulputate ridiculus platea arcu suspendisse donec</p>';
   echo do_shortcode( '[fluentform id="1"]' ); // Here goes your shortcode if needed
}

// 5. Go to Settings >> Permalinks and re-save permalinks. Otherwise you will end up with 404 Page not found error

Also, don’t forget to go to Settings >> Permalinks and resave your permalinks

How to merge Leardash profile and Woocommerce My account page?

I have made an in-depth tutorial on how to merge Learndash and Woocommerce but today I’m just going to show how to show Learndash profile inside Woocommerce my account. You just need to add this snippet here below.

// 1. Register new purchased-courses endpoint (URL) for My Account page
add_action( 'init', 'add_lms_endpoint' );
function add_lms_endpoint() {
    add_rewrite_endpoint( 'purchased-courses', EP_ROOT | EP_PAGES );
}
  
// 2. Add new query var
add_filter( 'query_vars', 'courses_query_vars', 0 );  
function courses_query_vars( $vars ) {
    $vars[] = 'purchased-courses';
    return $vars;
}
  
// 3. Insert the new endpoint into the My Account menu
add_filter( 'woocommerce_account_menu_items', 'add_new_courses_tab', 40 );
function add_new_courses_tab( $items ) {
    $items['purchased-courses'] = 'Your courses';
    return $items;
}
  
// 4. Add content to the added tab
add_action( 'woocommerce_account_purchased-courses_endpoint', 'course_tab_content' ); // Note: add_action must follow 'woocommerce_account_{your-endpoint-slug}_endpoint' format

function course_tab_content() {
   echo '<h4><strong>All your courses</strong></h4>
   <p>Fermentum tristique non imperdiet vulputate ridiculus platea arcu suspendisse donec</p>';
   echo do_shortcode( ' [ld_profile]' ); // Here goes your shortcode if needed
}

As before, don’t forget to go to Settings >> Permalinks and resave your permalinks

How to remove Woocommerce my account tabs?

There are a bunch of Woocommerce endpoints, and maybe you don’t need a couple of them and therefore let’s see how to remove Woocommerce my account tabs. For example, let’s remove Downloads tab (endpoint). It’ s fairly easy. Go to Woocommerce >> Settings >> Advandes and take a look at the “Account endpoints” section.

Now find Downloads and delete content from it and save changes (see the screenshot).

How to remove Woocommerce my account tabs?

This will remove Downaods endpoint from your Woocommerce My account page.

How to remove Woocommerce Dashboard tab from My account page?

Although you can remove all other tabs, you cannot use this method shown above to remove Woocommerce Dashboard tab from my account page. To accomplish that, use this snippet here instead.

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

How to reorder Woocommerce my account tabs?

Now let’s take a look at how to remove Woocommerce my account tabs. Since we added two tabs (Support and Your courses) earliel they will end up down bottom on the tabs list. I would like to reorder their location. So, let’s add this code to the code snippets.

// Reorder Woocommerce my account tabs?
function change_my_account_menu_order() {
 	$menuOrder = array(
	'dashboard'          => __( 'Dashboard', 'woocommerce' ),
 	'orders'             => __( 'Orders', 'woocommerce' ),
 	'purchased-courses'   => __( 'Your courses', 'woocommerce' ),
	'customer-support'   => __( 'Support', 'woocommerce' ),
        'downloads'   => __( 'Downloads', 'woocommerce' ),
 	'edit-address'       => __( 'My ddresses', 'woocommerce' ),
 	'edit-account'    	=> __( 'Account Details', 'woocommerce' ),
 	'customer-logout'    => __( 'Logout', 'woocommerce' )
 	);
 	return $menuOrder;
 }
 add_filter ( 'woocommerce_account_menu_items', 'change_my_account_menu_order' );

Pay attention that you need to add all the active tabs inside this code. If you have removed Downloads as I showed previously then don’t add Downloads in the list. Now just reorder them as you like. As you see Your Courses is in the 3rd position and Support is fourth.

ALSO don’t forget to pay attentio to the endpoint URL-s part ins the code ( ‘purchased-courses’ for example).

How to rename Woocommerce my account tabs?

If you need to rename Woocommerce my account tabs then take the code shown in the previous step and just rename your tab names. For example, I’m going to rename Dashboard to My dashboard and Orders to My orders.

function rename_my_account_menu_order() {
 	$menuOrder = array(
	  	'dashboard'          => __( 'My dashboard', 'woocommerce' ),
 		'orders'             => __( 'My orders', 'woocommerce' ),
 		'purchased-courses'   => __( 'Your courses', 'woocommerce' ),
	         'customer-support'   => __( 'Support', 'woocommerce' ),
                 'downloads'   => __( 'Downloads', 'woocommerce' ),
 		'edit-address'       => __( 'My ddresses', 'woocommerce' ),
 		'edit-account'    	=> __( 'Account Details', 'woocommerce' ),
 		'customer-logout'    => __( 'Logout', 'woocommerce' )
 	);
 	return $menuOrder;
 }
 add_filter ( 'woocommerce_account_menu_items', 'rename_my_account_menu_order' );

If you need to reorder and rename them together then use one snippet for both.

Well, that’s basically it. Now you know how to rename, remove, reorder and add Woocommerce My Account tabs?

Here are some of my favorite WordPress tools

Thanks for reading this article! I hope it's been useful as you work on your own websites and e-commerce sites. I wanted to share some tools I use as a WordPress developer, and I think you'll find them helpful too.

Just so you know, these are affiliate links. If you decide to use any of them, I'll earn a commission. This helps me create tutorials and YouTube videos. But honestly, I genuinely use and recommend these tools to my friends and family as well. Your support keeps me creating content that benefits everyone.

Themes: Over the past few years, I've consistently relied on two primary themes for all sorts of projects: the Blocksy theme and the Kadence Theme. If you explore this website and my YouTube channel, you'll come across numerous tutorials that delve into these themes. If you're interested in obtaining a 10% discount for both of these themes, then:

Code Snippets Manager: WPCodeBox allows you to add code snippets to your site. Not only that, but it also provides you with the capability to construct and oversee your WordPress Code Snippets library right in the cloud. You can grab it with the 20% discount here (SAVE 20% Coupon: WPSH20).

Contact forms: There are hundreds of contact forms out there but Fluent Forms is the one I like the most. If you need a 20% discount then use this link (save 20% coupon is WPSH20).

Gutenberg add-ons: If I need a good Gutenberg blocks add-on then Kadence Blocks is the one I have used the most. You’ll get a 10% discount with the coupon SIMPLEHACKS here.

Website migration: While building a website you probably need a good plugin that can help you with the migration, backups, restoration, and staging sites. Well, WpVivid is the one I have used for the last couple of years. If you use this link along with the WPSH20 coupon you’ll get a 20% discount.

Woocommerce extensions: There are a bunch of Woocommerce extensions that I like but the one that stands out is Advanced Dynamic Pricing. Once again, you’ll get a 20% discount if you use this link here (save 20% coupon is WPSH20)

Web Hosting: If you would like to have a really fast and easy-to-use managed cloud hosting, then I recommend Verpex Hosting (see my review here). By the way, this site is hosted in Verpex.)

To see all my most up-to-date recommendations, check out this resource that I made for you!

Do you want to thank me and buy me a beer?

Every donation is entirely welcome but NEVER required. Enjoy my work for free but if you would like to thank me and buy me a beer or two then you can use this form here below.

Donation Form (#2)

Janek T.
Janek T.

Improve this text: {CLIPBOARD}

- I have been passionate about Wordpress since 2011, creating websites and sharing valuable tips on using Wordpress and Woocommerce on my site.
- Be the first to receive notifications about new tutorials by subscribing to my Youtube channel .
- Follow me on Twitter here

Articles: 108