Business Bloomer
  • About
  • WooCommerce Blog
  • Online Courses
  • Login
  • 0
  • About
  • WooCommerce Blog
  • Online Courses
  • Login
  • 0

WooCommerce: Add New Tab @ My Account Page

> Published: Nov 2016 - Revised: Mar 2021
> Blog Category: WooCommerce Tips
> Blog Tags: My Account
> Blog Comments: 209 Comments
Tweet

Join 17,000+ WooWeekly subscribers

One of the features of Bloomer Armada is the provision of Premium WooCommerce Q&A Support to supporters who enroll. So, how to add an extra “tab” to the My Account page, and how to add content inside it?

Here’s the code I used (thanks to Mike Jolley for inspiration) – feel free to leave a comment below if you found this tutorial useful 🙂

WooCommerce: How to Add a New Tab to the My Account Page
WooCommerce: How to Add a New Tab to the My Account Page

PHP Snippet: How to Add a New Tab @ WooCommerce My Account Page

/**
 * @snippet       WooCommerce Add New Tab @ My Account
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 5.0
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */
 
// ------------------
// 1. Register new endpoint (URL) for My Account page
// Note: Re-save Permalinks or it will give 404 error
 
function bbloomer_add_premium_support_endpoint() {
    add_rewrite_endpoint( 'premium-support', EP_ROOT | EP_PAGES );
}
 
add_action( 'init', 'bbloomer_add_premium_support_endpoint' );
 
// ------------------
// 2. Add new query var
 
function bbloomer_premium_support_query_vars( $vars ) {
    $vars[] = 'premium-support';
    return $vars;
}
 
add_filter( 'query_vars', 'bbloomer_premium_support_query_vars', 0 );
 
// ------------------
// 3. Insert the new endpoint into the My Account menu
 
function bbloomer_add_premium_support_link_my_account( $items ) {
    $items['premium-support'] = 'Premium Support';
    return $items;
}
 
add_filter( 'woocommerce_account_menu_items', 'bbloomer_add_premium_support_link_my_account' );
 
// ------------------
// 4. Add content to the new tab
 
function bbloomer_premium_support_content() {
   echo '<h3>Premium WooCommerce Support</h3><p>Welcome to the WooCommerce support area. As a premium customer, you can submit a ticket should you have any WooCommerce issues with your website, snippets or customization. <i>Please contact your theme/plugin developer for theme/plugin-related support.</i></p>';
   echo do_shortcode( ' /* your shortcode here */ ' );
}
 
add_action( 'woocommerce_account_premium-support_endpoint', 'bbloomer_premium_support_content' );
// Note: add_action must follow 'woocommerce_account_{your-endpoint-slug}_endpoint' format

Is There a (Reliable) Plugin For That?

If you’d love to code but don’t feel 100% confident with PHP, I decided to look for a reliable plugin that achieves the same result.

In this case, I recommend the YITH WooCommerce Customize My Account Page plugin. On top of adding new My Account tabs, you can also move the tab menu around, customize the color scheme, add banners, set up reCaptcha on the register and login forms, sort, rename, delete and group tabs, conditionally show tabs to a given user role and much more.

But in case you hate plugins and wish to code (or wish to try that), then keep reading 🙂

Related posts:

  1. WooCommerce: Add First & Last Name to My Account Register Form
  2. WooCommerce: Change User Role for New Customers
  3. WooCommerce: Add Select Field to “My Account” Register Form
  4. WooCommerce: Add Privacy Policy Consent @ My Account Registration
  5. WooCommerce: Separate Login, Registration, My Account Pages
  6. WooCommerce: Allow Users to Edit Processing Orders
  7. WooCommerce: Deny Automatic Login Upon Registration @ My Account
  8. WooCommerce: File Upload @ My Account Registration Form
  9. WooCommerce: Rename “My Account” If Logged Out @ Nav Menu
  10. WooCommerce: Add a Custom Download File @ My Account

Where to add this snippet?

You can place PHP snippets at the bottom of your child theme functions.php file (delete "?>" if you have it there). CSS, on the other hand, goes in your child theme style.css file. Make sure you know what you are doing when editing such files - if you need more guidance, please take a look at my free video tutorial "Where to Place WooCommerce Customization?"

Does this snippet (still) work?

Please let me know in the comments if everything worked as expected. I would be happy to revise the snippet if you report otherwise (please provide screenshots). I have tested this code with Storefront theme, the WooCommerce version listed above and a WordPress-friendly hosting on PHP 7.3.

If you think this code saved you time & money, feel free to join 14,000+ WooCommerce Weekly subscribers for blog post updates or 250+ Business Bloomer supporters for 365 days of WooCommerce benefits. Thank you in advance :)

Need Help with WooCommerce?

Check out these free video tutorials. You can learn how to customize WooCommerce without unnecessary plugins, how to properly configure the WooCommerce plugin settings and even how to master WooCommerce troubleshooting in case of a bug!

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.

Follow @rmelogli
Category: WooCommerce Tips
Tag: My Account

Post navigation

Previous post: WooCommerce: Hide/Show The WP Admin Bar
Next post: WooCommerce: 85 Free Plugins for Every Challenge

209 thoughts on “WooCommerce: Add New Tab @ My Account Page”

  1. Simon Dawson
    December 6, 2021

    Hi Rodolfo – this is awesome (as are all your code snippets!). One question, the new page always has the standard dashboard copy at the top e.g. “Hello XXXXXX (not XXXXXX? Log out) From your account dashboard you can view your recent orders, manage your shipping and billing addresses, and edit your password and account details.” – is there any way to remove this and just display the content from bbloomer_premium_support_content() function at all?

    Thanks!
    Si

    Reply
    1. Rodolfo Melogli
      January 8, 2022

      Thanks Si! That should not happen. Did you use the exact same code?

      Reply
      1. Ricardo
        February 27, 2022

        Had the same issue. Fixed it by applying what the note was saying. You need to use the add_action exactly as shown in the note.

        // Note: add_action must follow ‘woocommerce_account_{your-endpoint-slug}_endpoint’ format

        The question I have is why? Where is that documented? I would like to understand it better. Otherwise I feel kind of lost…

        Reply
        1. Rodolfo Melogli
          March 6, 2022

          You could do a file search trough the WooCommerce plugin for “do_action( ‘woocommerce_account_'” and you’ll see where it’s called. Let me know

          Reply
          1. Kiran
            December 19, 2022

            I added this code to the website but when I click on the custom tab it redirects to a not found page.

            Reply
            1. Rodolfo Melogli
              January 13, 2023

              Did you save WordPress permalinks?

              Reply
  2. Howard Jacobson
    August 23, 2021

    Thanks for a great tip. This helped me exactly as I needed.

    Reply
    1. Rodolfo Melogli
      September 15, 2021

      Great!

      Reply
  3. Terrance
    June 18, 2021

    HI Thank you very much for the great tutorial. I added the codes. and i can see the new tab appears in my account page . but when i click on it its giving me a 404 error. do i have to create a page for the new endpoint? kindly help me on this.

    Reply
    1. Rodolfo Melogli
      August 1, 2021

      Nope. Did you refresh permalinks?

      Reply
      1. Razvan
        October 6, 2021

        Add

        flush_rewrite_rules();

        after

        add_rewrite_endpoint( 'premium-support', EP_ROOT | EP_PAGES );

        and the 404 error will disappear without having to refresh the permalinks.

        Reply
        1. Rodolfo Melogli
          October 12, 2021

          Fantastic

          Reply
  4. Tiz
    June 8, 2021

    Hi
    I have a question about this note:
    Re-save Permalinks or it will give 404 error
    If I am building a plugin that need to add New Tab @ My Account Page
    I can not tell the user to save his permalinks again after he install my plugin…

    Reply
    1. Rodolfo Melogli
      July 22, 2021

      Maybe at plugin level this is not needed. Give it a go

      Reply
  5. Cordial
    May 15, 2021

    Hello Sir,
    I followed your Code Snippets and I was able to add First Name and Last Name to the Registration Form. This means that you gave me the power to add anything I like on the Registration Form.

    Now, what I want to do is that –I want to add a Field to the Registration Form. This field will be a simple Text field called “TAG NUMBER”.

    During Registration, a User enters this Tag Number.

    Then when they log in and enter their Dashboard, I want this number to show among the Dashboard Endpoints, but it wouldn’t be a link. It will just be a simple Text field showing the Tag Number the user filled in, during Registration. Something like this– https://prntscr.com/12ypdi9

    How can this be done?

    Reply
    1. Rodolfo Melogli
      June 2, 2021

      Hi Cordial, please take a look at https://www.businessbloomer.com/woocommerce-visual-hook-guide-account-pages/ and see if you can identify a hook that can allow you to print the info in that exact position

      Reply
  6. Anas
    April 24, 2021

    Hi, this is great. Is there a way to have the new item I’ve added to the “my account” page to appear only for specific user roles?

    Thanks

    Reply
    1. Rodolfo Melogli
      May 7, 2021

      Hi Anas, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
      1. Kent Patrick
        May 18, 2021

        Custom Work? Seriously? Its a simple single line to add to the snippet already provided, add to each function

        if(wc_current_user_has_role( 'custom-role' )) return $vars; 

        change $vars to $items or remove variable if none are returned. Easy

        Reply
        1. Rodolfo Melogli
          June 2, 2021

          Thanks for your feedback Kent, but take it easy ah

          Reply
  7. Julius M Sapija
    April 7, 2021

    Hallo, this is great, thx for share this

    but im still confusing with my problem.
    i put my shortcode in content, but in my shortcode have many link.

    how i can do like this structure.
    my-account/support/a-z

    link a = new shortcode, and etc

    Reply
    1. Rodolfo Melogli
      April 20, 2021

      Hello Julius, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
      1. Kent Patrick
        May 18, 2021

        My recommendation is to use:
        my-account/support/?filter=a

        instead of:
        my-account/support/a

        This way you can just apply a reference to $_GET[‘filter’] and pass that through your shortcode

        \add_shortcode( 'example_support', 'example_support' ) );
        
        function example_support(array $atts ) {
        		\shortcode_atts(
        			array(
        				'filter' => 'a',
        			),
        			$atts
        		);
        
        		return "The filter applied was: {$atts[ 'filter' ]}.';
        	}
        
        function bbloomer_premium_support_content() {
        	echo do_shortcode( ' [example_support filter="' . $_GET['filter'] . '"] ' );
        }
        
        Reply
        1. Rodolfo Melogli
          June 2, 2021

          Thanks for your feedback Kent

          Reply
  8. Alain Aubry
    February 20, 2021

    Thank you so much for a great tutorial.
    I wanted to change the page title according to the menu item, after many internet searches and experimentation, I came to this:

    add_filter( 'the_title', 'my_custom_endpoint_title' );
    function my_custom_endpoint_title( $title ) {
    	global $wp_query;
    	$is_endpoint = isset( $wp_query->query_vars['my-endpoint'] );
    	if ( $is_endpoint && ! is_admin() && is_main_query() && in_the_loop() && is_account_page() ) {
    		// New page title.
    		$title = __( 'Endpoint Title', 'woocommerce' );
    		remove_filter( 'the_title', 'my_custom_endpoint_title' );
    	}
    	return $title;
    }
    

    I share in case it helps somebody else.

    Reply
    1. Rodolfo Melogli
      March 11, 2021

      Cheers Alain!

      Reply
  9. Lu
    November 24, 2020

    Hi Rodolfo,
    code put the endpoints in the my-account page but they redirect me to the page itself,
    I mean: i want the page to be shown in the my account page (dynamically?) with the tabs still visible and not being redirect to the pages.

    how can I fix it?

    thank you.

    Reply
    1. Rodolfo Melogli
      November 25, 2020

      Did you save permalinks?

      Reply
      1. Carlos
        January 16, 2021

        What is to save permalinks? How do I save permalinks?

        Reply
        1. Rodolfo Melogli
          February 6, 2021

          Go to “permalinks” in your WP admin and hit “Update”

          Reply
  10. Claudia
    September 14, 2020

    Great post!!! It worked perfectly, thank you very much.

    Reply
    1. Rodolfo Melogli
      September 21, 2020

      Nice!

      Reply
  11. Kelly
    September 3, 2020

    Hi, I want to add a custom url. I have changed the term ‘premium-support’ in all 3 instances it occurs to my custom url, but when I click the new tab on my account page it loads the dashboard.
    I have tried re-setting the permalinks
    Can you help?

    Reply
    1. Rodolfo Melogli
      September 10, 2020

      Hello Kelly, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  12. Juha
    August 24, 2020

    Is it possible to add an attribute selector so the customer can change product variation from my orders page?
    Like if selling tickets to different start groups and I need to allow customer change that start group in my account orders page?

    Reply
    1. Rodolfo Melogli
      August 28, 2020

      Hi Juha, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  13. Fatimah azzahra
    July 18, 2020

    sir i need your help, how to move to the bottom logout tab
    thanks alot sir

    Reply
    1. Rodolfo Melogli
      July 20, 2020

      Hi Fatimah, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  14. Kim
    June 20, 2020

    Hi. Thank you for the code. I used it in my website and it’s working perfectly. I would like to know how I can add another end point/tab. This code shows how to add one tab so I would like to know if it’s possible to add more tabs to the my account page menu.

    Reply
    1. Rodolfo Melogli
      June 28, 2020

      Yes totally possible inside the same functions

      Reply
  15. Kim
    June 20, 2020

    Hi. Thank you for this code. I used it in my website and it’s working well on desktop. But on mobile, the new tab opens up in another window instead of opening up in the same frame like the other default tabs. How can I make the new tab open up in the same frame like the default tabs?

    Reply
    1. Kim
      June 20, 2020

      Never mind. The issue is solved.

      Reply
      1. Rodolfo Melogli
        June 28, 2020

        Nice!

        Reply
  16. Rodrigo
    May 21, 2020

    Thanks for the code!

    I want to leave a tip for everyone else so you don’t need to spend 2 hours in the 404 error like I did.
    If resaving the permalinks is not working for you, try changing the theme to any other and then back to the one you are using. This is what finally made it work for me.

    As a bonus, I would like to leave another tip. If you want “Logout” to remain your last item:

    // ------------------
    // 3. Insert the new endpoint into the My Account menu
      
    function bbloomer_add_premium_support_link_my_account( $items ) {
    // Remove the logout menu item.
    $logout = $items['customer-logout'];
    unset( $items['customer-logout'] );
    
    // Insert your custom endpoint.
    $items['premium-support'] = 'Premium Support';
    
    // Insert back the logout item.
    $items['customer-logout'] = $logout;
    
    return $items;
    }
      
    add_filter( 'woocommerce_account_menu_items', 'bbloomer_add_premium_support_link_my_account' );
      
    Reply
    1. Rodolfo Melogli
      May 26, 2020

      Nice!

      Reply
      1. Donna
        May 11, 2021

        So much love for this one!

        Reply
  17. Lbz
    May 16, 2020

    Great post! The code works perfectly! I was wondering if there was a way to make it so only certain users can see that new account tab?

    Reply
    1. Rodolfo Melogli
      May 26, 2020

      Hi there, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  18. Anggi
    April 20, 2020

    hi, thanks for tutorial, although it was little bit confused, because, when I copy-paste your code to function theme, the links go through to “Premium Support” page that I created to avoid 404 File Not Found. The content of end point that wrote on 4 steps not also working, so I recheck again your code, and I add permalink like this:

    // ------------------
    // 1. Register new endpoint to use for My Account page
    // Note: Resave Permalinks or it will give 404 error
    
    function bbloomer_add_premium_support_endpoint() {
        add_rewrite_endpoint( 'my-account/premium-support', EP_ROOT | EP_PAGES );
    }
    

    I add “my-account/premium support” permalink, and it works. the content of end point showed on the my-account page.

    thanks for great tutorial. you save my day!

    Reply
    1. Rodolfo Melogli
      April 20, 2020

      Nice!

      Reply
      1. Anggi
        April 21, 2020

        Hi Rodolfo, now I get little bit problem again. I tried to change the url slug to mine slug, it is “konfirmasi-pembayaran”. but everytime I change the slug, it is go through the “konfirmasi-pembayaran” page. here it is my code:

        /**
         * @snippet       WooCommerce Add New Tab @ My Account
         * @how-to        Get CustomizeWoo.com FREE
         * @author        Rodolfo Melogli
         * @compatible    WooCommerce 3.5.7
         * @donate $9     https://businessbloomer.com/bloomer-armada/
         */
          
        // ------------------
        // 1. Register new endpoint to use for My Account page
        // Note: Resave Permalinks or it will give 404 error
          
        function tambahtab_endpoint() {
            add_rewrite_endpoint( 'konfirmasi', EP_ROOT | EP_PAGES );
        }
          
        add_action( 'init', 'tambahtab_endpoint' );
        
        

        however, If I rollback the slug to premium support, the tab is working, eventough with different function name. I tried to add “my-account/konfirmasi-pembayaran” slug, but it is not working. what I am missing?

        thanks!

        Reply
        1. Anggi
          April 21, 2020

          ah never mind, I just resave permalink after I change the slug.

          Reply
          1. Rodolfo Melogli
            April 21, 2020

            Eheh great

            Reply
  19. Trev
    March 26, 2020

    Hi Rodolfo,

    Thank you very much for that snippet. It works like a charm.

    The new link is displayed under the “logout” link. How can I move it before ? I would like to keep the logout at the end.

    Regards.

    Reply
    1. Rodolfo Melogli
      March 27, 2020

      Great! For that, you’ll need to reorganize the array before you give it back to the frontend. So, yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  20. Kelson
    March 1, 2020

    Hi Rodolfo. I inserted exactly the same code as yours but it’s not working. Can you please give me a light? Thanks

    Reply
    1. Rodolfo Melogli
      March 2, 2020

      Can you switch temporarily to 2020 theme and see if it works there?

      Reply
      1. Nick Young
        March 16, 2020

        It worked fine for me. I did have to refresh my permalinks though. Thanks!

        Reply
        1. Rodolfo Melogli
          March 20, 2020

          Cool

          Reply
  21. Reload
    January 28, 2020

    Hi Rodolfo,

    I’ve tried this on a multisite sub-directory setup where I have my main site abc.com and a sub-site abc.com/shop (WooCoomerce install). I can’t get the custom endpoints to work there, they just redirect to my Hello World blog post.

    If the abc.com/shop site is setup as a Single WordPress install it works fine. I’ve tried saving the permalinks, but no luck. Is there an additional step needed to make this work in a Multisite sub-directory setup?

    Thanks.

    Reply
    1. Rodolfo Melogli
      January 28, 2020

      I don’t work with multisite so I can’t help you, sorry

      Reply
  22. Rina Levit
    December 13, 2019

    Thank you so much for your article!!! As I combine LearnDash profile page and WooCommerce, I have to make it good looking ) And also I can add achievements as a woo tab 🙂 Thank you once again ))

    Reply
    1. Rodolfo Melogli
      December 13, 2019

      Great!

      Reply
  23. Giusy
    December 9, 2019

    Hi,
    thanks for your post!
    I would like to know if it is possible to fulfill my need.
    At the end of the payment of a product I would like the customer to receive in his account a file with instructions for using the product.
    This is to allow the customer to keep this file in his account and to be able to download it in the future when he needs it.
    How could I do?
    Is the procedure recommended in the post right?
    Giusy P.

    Reply
    1. Rodolfo Melogli
      December 13, 2019

      Giusy, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  24. Grey
    November 1, 2019

    Hi, the tutorial is very useful! May I know is there any way to add 2 or more tabs/endpoints at the same time?
    Or maybe I just need to add all the code again and again every time I want to add new tab?

    Reply
    1. Rodolfo Melogli
      November 10, 2019

      Yes, you can do that within the same functions – just add new lines to them 🙂

      Reply
  25. Joseph
    September 25, 2019

    I’m having the same problem as babakFP but it’s not shortcode or plugin specific…it seems to do this with any shortcode that produces links. So basically if the shortcode inserted produces links and the links are clicked on, it doesn’t bring you to the correct subpage permalink within the ‘my account’ page; it actually just ends up bringing me back to the dashboard tab.

    For example:
    Added a new tab with content, located at this permalink: mysite.com/myaccount/newtab
    [my-shortcode] shows 3 links on the custom tab page –> link1, link2, link3
    Hovering/clicking the link directs to mysite.com/myaccount/?link1, mysite.com/myaccount/?link2, mysite.com/myaccount/?link3

    When it should be directing to a subpage within the custom tabs permalink, like so: mysite.com/myaccount/newtab/?link

    If I manually type in mysite.com/myaccount/newtab/?link, I can see the subpage produced by the shortcode, and I’ve tried this with 2 other plugins and it always does the same thing. My directory plugin wasn’t allowing me to go to paginated pages when clicking the pagination links, my courses plugin wouldn’t show active or completed courses. I also tried purchasing the YITH customize myaccount page to use instead of your tutorial, and this plugin produces the same problem. So I imagine it’s something to do with the code?

    Reply
    1. Rodolfo Melogli
      September 30, 2019

      Yes Joseph, this is quite specific, so you’ll need to customize either the shortcode or maybe set up custom .htaccess redirects

      Reply
  26. Jessi March
    August 25, 2019

    Hey Rodolfo,
    thank you for a great tutorial and code.
    I have a slightly different need than a new tab as ‘Premium Support’.
    I need to add the user role button on the my-account page.
    I have created 2 user roles and applied different discount for these paid users.
    So I am trying to somehow print user role of a current user as – You Are GOLD member (or) You Are PLATINUM member.
    I am not sure how to edit your code so at one place it will display {role_name} ?

    Reply
    1. Rodolfo Melogli
      August 29, 2019

      Hello Jessi, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  27. David
    July 29, 2019

    Got everything working….

    1. Added the tab in my account
    – shows up and is clickable
    2. Re-saved Permalinks

    Inserted my shortcode -> echo do_shortcode( ‘ [wwof_product_listing] ‘ );
    but when clicking the tab link it does not add my content. Just shows the same content from the previous tab.

    Can you point me in a direction?

    Thanks in advance
    David

    Reply
    1. Rodolfo Melogli
      August 1, 2019

      Hi David, thanks for your comment! I just tested this again with Storefront theme and it works perfectly. Maybe your theme (or another plugin) is messing/conflicting with my snippet?

      To troubleshoot, disable all plugins but WooCommerce and also switch temporarily to “Twentyseventeen” theme (load the snippet there in functions.php) – does it work? If yes, you have a problem with your current theme or one of the plugins.

      Hope this helps!

      R

      Reply
    2. Steven Hogenbosch
      November 20, 2019

      Hi David, seems I’m running into the same problem you had… with exactly the same plugin (WooCommerce Wholesale Order Form). Can you please tell me if you found out what was the problem and were you able to solve it?

      Reply
  28. babakFP
    July 18, 2019

    Hi
    I added Yith-Affiliate plugin shortcode to new custom menu content and the shortcode page has some links. when I click on these links it takes me to another page. I what to this links open inside myAccount page.

    Reply
    1. Rodolfo Melogli
      July 22, 2019

      Hi there – ask YITH support please

      Reply
  29. Antony
    July 11, 2019

    Hello!
    I want modify Premium Support title on woocommerce my account page to Chinese title.
    So I change the code and apply the new listed below (part):

    function bbloomer_add_premium_support_link_my_account( $items ) {
       $items[‘premium-support’] = “真的好”;
    return $items;
    }

    However, it can’t work. It shows: syntax error, unexpected ‘ ‘ (T_STRING)
    Is it caused by using Chinese character?

    Reply
    1. Rodolfo Melogli
      July 16, 2019

      That might be the problem, yes

      Reply
  30. pankaj Sharma
    May 14, 2019

    I am getting 404 error when open the custom link. Please help me

    Reply
    1. Rodolfo Melogli
      May 16, 2019

      Please resave your permalinks

      Reply
    2. Aditya vilas Rane
      June 25, 2019

      I am also not able open the premium support tab.
      page not found is the error occuring .
      I also tried to resave permalink file

      Reply
      1. Rodolfo Melogli
        July 6, 2019

        Please copy/paste your code in here:

        Reply
  31. Cyndi Kirkpatrick
    May 9, 2019

    Thank you for the helpful information. It worked for me. I am left with one small problem. I added a link for the Wishlist to the My Account menu. It does like to the Wishlist page, but that page displays the normal sidebar instead of the “My Account” sidebar. It’s only a small problem but I could see it confusing people. Is there a solution?

    Reply
    1. Rodolfo Melogli
      May 16, 2019

      Hi Cyndi, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  32. JB
    March 7, 2019

    Very helpful starting point. Thanks!

    We have a shortcode filter we use to limit the visibility of elements to certain users. I wonder where how we could call this to make the new tab only visible to certain users?

    [user_advertisers] [/oks_advertisers]

    It applies to the content just fine when added to the shortcode area in the snippet, but any suggestions as to how we could affect the tab visibility?

    Reply
    1. Rodolfo Melogli
      March 15, 2019

      Hello JB, thanks so much for your comment! Yes, this is possible – unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding! ~R

      Reply
  33. gmasterpos
    November 16, 2018

    HELLO
    please i will like to add upload file on my woocommerce registeration form please any help
    thanks

    Reply
    1. Rodolfo Melogli
      November 26, 2018

      Hi there, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

      Reply
  34. Jason
    November 14, 2018

    It’s working for me on WordPress 4.9.8. I’m also able to use it to insert an Elementor section using do_shortcode.

    Reply
    1. Rodolfo Melogli
      November 14, 2018

      Awesome 🙂

      Reply
  35. vieradel
    October 23, 2018

    It’s not working for me in the latest version of Wocommerce 3.4.7

    Reply
    1. Rodolfo Melogli
      October 30, 2018

      Hey there, it works for me 🙂 Can you try with another theme and only WooCommerce plugin active please?

      Reply
  36. g.bruno
    September 12, 2018

    Ciao Rodolfo! complimenti per gli articoli! I finally understand where to put the code, and it works fine! But as everyone i got small issue 🙂 . I added 2 more tab (my cart and my wishlist) and i would like to connect the 2 new tabs to their pages. that thing is that I don’t what to put in the “echo shortcode”. Should i put a link to redirect to the page?
    For example, the website is SooTasty, so I can put: sootasty.net/mycart..?
    Thanks in advance!!
    Giovanni

    Reply
    1. g.bruno
      September 13, 2018

      Hi Rodolfo, it’s me again. I actually find the solution for the shortcode after the echo function, I put simply [woocommerce_cart] and [yith_wcwl_wishlist] for the respective pages.

      and for changing the orders i use the same code as other comment and it worked!

       
      // Changing order
          
         function woocommerce_my_account_order() {
             $myorder = array(
                              'dashboard' => __( 'Dashboard', 'woocommerce' ),
                              'orders' => __( 'Orders', 'woocommerce' ),
                              'my-cart' => __( 'My Cart', 'woocommerce' ),
                              'my-wishlist' => __( 'My Wishlist', 'woocommerce' ),
                              'edit-account' => __( 'Account details', 'woocommerce' ),
                              'edit-address' => __( 'Edit addresses', 'woocommerce' ),
                              'customer-logout' => __( 'Logout', 'woocommerce' ),
                              );
             return $myorder;
         }
         add_filter ( 'woocommerce_account_menu_items', 'woocommerce_my_account_order' );
      
      ?>
      

      Thanks again for your article! i could not make it without! 🙂

      Reply
      1. Rodolfo Melogli
        September 20, 2018

        Nice 🙂

        Reply
  37. Giancarlo Ospina
    September 10, 2018

    Hey, Rodolfo!

    I think it would be helpful to explain how the woocommerce_account_information_endpoint action works. This is a custom action that you can use for any endpoint you create by formatting it like so woocommerce_account_{your-endpoint-slug}_endpoint.

    I think this will lead to a lot less confusion for those who want to you shortcodes from other plugins or their own content in general. I don’t if everyone knows that you also have to replace “premium-support” in this final action as well.

    Reply
    1. Rodolfo Melogli
      September 12, 2018

      Good point Giancarlo!

      Reply
  38. sunny
    August 31, 2018

    Hi Rodolfo,

    Ho can we make that custom tab to be hyperlinked, for ex: when someone clicks on support tab, it will take them to that page instead of displaying content.

    Reply
    1. Rodolfo Melogli
      September 3, 2018

      Hey Sunny – thanks so much for your comment! That should already work like that 🙂

      Reply
  39. Undefined person
    August 29, 2018

    Thanks to author, very helpful. But i didn’t find info about how to change the new tab page title (in top section of “My Account” page). I found info on another site (maybe should be useful for someone): https://github.com/woocommerce/woocommerce/wiki/Customising-account-page-tabs

    Reply
    1. Rodolfo Melogli
      September 3, 2018

      Nice – thanks so much for your comment “Undefined person” 😀

      Reply
  40. MS Shohan
    July 29, 2018

    The snippet is not working. I am using the latest version of woocommerce

    Reply
    1. Rodolfo Melogli
      August 7, 2018

      Hey there, thanks for your feedback! If you temporarily switch to 2017 theme, does the snippet work?

      Reply
  41. yea73920
    June 26, 2018

    Very Great Snippet,

    I add on tab success,But I don’t know how to add more,

    Could you make an example snippet ?

    Thank you very much~

    BR

    James

    Reply
    1. Rodolfo Melogli
      June 26, 2018

      Hey James, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

      Reply
  42. Latheesh
    June 22, 2018

    Hi is it okay to use
    /* Flush rewrite rules for custom post types. */
    add_action( ‘after_switch_theme’, ‘flush_rewrite_rules’ );

    so that need for flushing the permalink can be avoided?

    Reply
    1. Rodolfo Melogli
      June 26, 2018

      Not a good idea Latheesh, you only need to flush the permalinks once 🙂

      Reply
  43. Sharon
    June 12, 2018

    Thank you for yet another fantastic snippet, Rodolfo.

    I just used this to create a custom memberships area that shows different text and divs–depending on whether or not a user is a community member.

    By the way, if anyone else is using Woo’s Membership plugin, or shortcodes that wrap around text, this variation may help:

     
    
    echo do_shortcode('[your-shortcode]<p>Put your text here.</p>[/your-shortcode]');
    
    

    Please let me know if I’m wrong (or stepping on your toes), Rodolfo. I just thought it might save folks some time.

    Thanks again! 🙂

    Reply
    1. Rodolfo Melogli
      June 13, 2018

      Awesome stuff Sharon, thanks! 🙂

      Reply
  44. Simon Ilett
    May 25, 2018

    Still working, you should make the SAVE PERMALINKS AGAIN notice a bit larger. It caught me out at the start!

    Thanks for the code!!

    Reply
    1. Rodolfo Melogli
      May 25, 2018

      Awesome 🙂

      Reply
    2. Sebastien Albert
      August 13, 2018

      Hi guys,
      It looks wonderful ! but I need to know what do you mean by resave permalink because I have the 404 issue with my new tab.

      Thanks.

      Reply
      1. Rodolfo Melogli
        August 16, 2018

        No problem at all Sebastien. Go to “/wp-admin/options-permalink.php” and click on “Save Changes” 🙂

        Reply
  45. Skynet
    May 21, 2018

    Hi 🙂

    I use your php code to add a tab, thank you it works very well. I would like to integrate an elementor contact form in this new tab (via shortcode) how to do?

    Reply
    1. Rodolfo Melogli
      May 25, 2018

      Hey there and thanks for your comment 🙂 In section 4 of the snippet I added a custom shortcode, so you can do the same with yours. Hope this helps!

      Reply
  46. Dexter
    May 18, 2018

    Thank You – this is awesome start for new GDPR thing, for exeample if you want to add a tab where users can download their personal data. Works like a charm!

    Reply
    1. Rodolfo Melogli
      May 21, 2018

      Excellent 🙂

      Reply
  47. Elisabeth
    May 1, 2018

    Hi Rodolfo, thanks for the code. I can tell you it still works!
    I ran into a little issue though. After copy + paste into my child theme’s functions.php + saving permalinks I noticed it worked! Unfortunately, I also lost my translations and a custom tab that was there before. So I ‘undid’ my actions: I deleted the code again from my child theme’s functions.php and saved the permalinks again.

    But my ‘undo’ strategy didn’t work. Did I do something wrong? What should I do to properly ‘undo’ it?

    Reply
    1. Elisabeth
      May 1, 2018

      Hi Rodolfo, I DID do something wrong. Luckily I found out what it was.

      Thanks so much for your code and instructions!

      Regards, Elisabeth

      Reply
      1. Rodolfo Melogli
        May 3, 2018

        Excellent 🙂

        Reply
  48. UgoChukwu
    May 1, 2018

    I want to add multiple submenu displaying their contents using short codes

    I duplicated this snippet and made some edit. But after the first and second edit, the third edit don’t seems to work.
    It always redirects to the second edit, when the second snippet is deactivated, it runs normal.

    Is there a way I can add multiple sub menu under one snippet without duplicating and editing?

    Reply
    1. Rodolfo Melogli
      May 3, 2018

      Hey Ugo, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom troubleshooting work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

      Reply
  49. Mike
    April 6, 2018

    Hi! If I use the Code Snippets plugin, can all of the code be added to a single snippet? I’m going to try this to display an Elementor layout shortcode in a tab.

    Reply
    1. Mike
      April 6, 2018

      Also, what exactly should be changed if I don’t want it to say Premium Support on the tab? I think everything else should stay the same as your code?

      Reply
      1. Rodolfo Melogli
        April 10, 2018

        Hey Mike, thank you so much for your comment! Yes, you can place as much PHP as you like inside a single snippet. Also, to change the “Premium Support” label, edit this line:

        $items['premium-support'] = 'Premium Support';
        
        Reply
  50. A Ratiña
    March 14, 2018

    Great job! It worked for me!
    Thanks a lot!

    Reply
    1. Rodolfo Melogli
      March 16, 2018

      Great 🙂

      Reply
  51. Stuart
    January 2, 2018

    Hi Rodolfo,

    I am having a strange problem with this solution (and every other solution). I have added the new account tab, the page works. I have added the shortcode I wanted to add, and the html generated content is being outputted on the new tab but the content does not function correctly as the css and js that needs to be added to the page by the shortcode has not been added. If I add the shortcode to any normal page the js and css is added correctly. Please can you help?

    Kind regards,
    Stuart

    Reply
    1. Rodolfo Melogli
      January 9, 2018

      Stuart, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

      Reply
  52. طراحی سایت اختصاصی
    October 24, 2017

    hi
    this worked bottom of logout
    how can change priority of tab??

    Reply
    1. Rodolfo Melogli
      October 25, 2017

      Hi there, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

      Reply
  53. Poras
    October 13, 2017

    Hi Rodolfo
    Thanks you very much . It ‘s woking for me . but i want to know how to open page on click of this added tab and can you help me please how to reorder this tab .

    Reply
    1. Rodolfo Melogli
      October 16, 2017

      Hi Poras, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

      Reply
  54. gurdeep
    October 13, 2017

    hi
    where we put add filter function

    Reply
    1. Rodolfo Melogli
      October 16, 2017

      Hey Gurdeep, thanks so much for your comment! You can place this in your child theme’s functions.php file – if you need more guidance, please take a look at this video tutorial: https://businessbloomer.com/woocommerce-customization-hangout/. Hope this helps!

      Reply
  55. Harry
    September 20, 2017

    Hi Rodolfo
    You instruction are very helpful with Snippets. I don’t know coding at all. I searched more than 15-20 links to created tab in “My Account” section , None of them Worked but your worked Straight away as soon i put in Snippet Plugin.
    Do you have any Snippet code that i use to make Tab “Create Return” when clicked open a form Name>Email id>Order Id>Product Id/Name>Reason. And when they submit i can get a email with details?
    Or as you created Premium support , Can i change name for it to “Create Return” and link to my Returns Page with the form i already made?
    Honestly i don’t know meaning for Snippets,Html, etc, I don’t know how to even use them ,all i know is Put them in SiteoriginCSS plugin as per google.
    Would really appreciate your help.
    Thanks
    Harry

    Reply
    1. Rodolfo Melogli
      September 22, 2017

      Harry, thanks for your comment! Maybe you could use a “Redirection” plugin to redirect from the new account tab to your return page. Hope this helps!

      Reply
  56. Reese
    August 10, 2017

    Hi Rudolf,

    This works great for me, I wanted to add the publicly visible report-page for a plugin in the My Account menu, and I have been able to do just that, the page I wanted to link to has been auto-generated by the plugin and without adding the 301 plugin you mentioned above, the new endpoint links perfectly to the correct page.

    My question then is, how can I add the end-points menu to this auto-generated page, so that visitors can return not only to the my account page, but also to its other subpages, directly? Or is this a question better aimed at the plugin developer?

    thanks a lot,
    — Reese

    Reply
    1. Rodolfo Melogli
      August 16, 2017

      Yes Reese, I guess they’re your best bet 🙂

      Reply
  57. Shazzad Hossain
    July 10, 2017

    There’s another thing that can be added.

    add_filter( 'woocommerce_endpoint_bbloomer_premium_support_title', 'bbloomer_premium_support_page_title' );
    function bbloomer_premium_support_page_title( $title ){
        return 'BBloomer Premium Support';
    }
    

    Thanks.

    Reply
    1. Rodolfo Melogli
      July 11, 2017

      Thanks Shazzad 🙂

      Reply
  58. jack li
    June 19, 2017

    hi Rodolfo, thanks for the post and really help me alot. Now I have add a new tab call- “personal info”, it link to a form asking the customer input some info such as gender, bio, etc. So each customer have their own info because they are different. when they first login, they can have a chance to create a new entry. but later on, they might want to change something and they are able to do so, the old data will show and able to change by clicking the EDIT for that entry, not creating a new one. Just as the “Addresses” field in the MY ACCOUNT. So Rodolfo, can you help me how to do this. thanks.

    Reply
    1. Rodolfo Melogli
      June 23, 2017

      Jack, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here on the blog. Thanks a lot for your understanding! ~R

      Reply
  59. Diederik
    June 7, 2017

    Hi Rodolfo,

    How do I point the new tab to an URL instead ?

    Reply
    1. Rodolfo Melogli
      June 9, 2017

      Hey Diederik, thanks for your comment! I suggest using https://wordpress.org/plugins/simple-301-redirects/

      Reply
  60. Sehrish
    June 1, 2017

    I’m getting 404 error. Double check code, deactivated all plugins but no success.

    Reply
    1. Rodolfo Melogli
      June 8, 2017

      Hey Sehrish, go to Settings > Permalinks > “Save Changes”. That will fix it 🙂

      Reply
  61. Radoslav
    May 31, 2017

    Hi Rodolfo,

    Everything is perfect and I have no problem creating the extra option. Since I’ve created a “Order Tracking” page, how can I do by clicking “Premium Support” to redirect to the page I’ve created? thanks.

    Reply
    1. Rodolfo Melogli
      June 8, 2017

      Radoslav, thanks for your comment! So, you want to have a redirect? Maybe use the Simple 301 plugin for that 🙂

      Reply
  62. Ahmet
    May 29, 2017

    I just searching what exactly “support ticket” system for woocommerce and you wrote exactly what i want to do. Thank you so much

    Reply
    1. Rodolfo Melogli
      June 8, 2017

      Ah, awesome Ahmet! 🙂

      Reply
  63. Mark
    May 16, 2017

    Hi, Rodolfo,
    thank you for everything you do.
    I applied your code and is working great. One thing is bothering me though: how can i make display the custom tab title as entry header – instead of My account, when clicking on the tab?
    Thanks.

    Reply
    1. Rodolfo Melogli
      May 18, 2017

      Thanks Mark! Do you have a screenshot to help me understand?

      Reply
  64. Matt Hartwell
    May 10, 2017

    Just wondering what ticket system you are using. I tested a few and decided to go with Awesome Support as an onsite soluion for my project, but the screenies of your support area look a lot better than mine, which is fairly clunky.

    Are you using a custom solution or a plugin?

    Regards
    Matt

    Reply
    1. Rodolfo Melogli
      May 10, 2017

      Thanks for your comment Matt! I use https://wordpress.org/plugins/wp-support-plus-responsive-ticket-system/ 🙂

      Reply
  65. ebrahim torabi
    April 25, 2017

    thank you.
    i get 404 err,fix with re save permalink setting.

    Reply
    1. Rodolfo Melogli
      April 28, 2017

      Hey Ebrahim thanks for your comment and sorry to hear this doesn’t work! I use it on my own website so I can guarantee this is meant to work. Try using the latest WooCommerce and a default theme like “2016” and test it again – let me know 🙂

      Reply
    2. Caroline P
      August 18, 2018

      Try switching to a theme like twentyseventeen or storefront, then switching back to your own theme. After re-saving permalinks didn’t work for me, this did.

      Reply
  66. David PEarce
    April 10, 2017

    Hey!

    Great snippet.

    How would I go about making the endpoint page specific to a select user or user role?

    Reply
    1. Rodolfo Melogli
      April 12, 2017

      Hey David, thanks for your comment! Take a look at this other unrelated snippet: https://businessbloomer.com/disable-payment-gateway-specific-user-role-woocommerce/. In here you can learn how to “target” a user role 🙂

      Reply
  67. Thomas
    April 4, 2017

    Your custom tab also displays a custom icon, would you mind explaining, how this can be accomplished ?

    Thank you very much in advance!

    Reply
    1. Rodolfo Melogli
      April 4, 2017

      Hey Thomas thanks for your question! You can achieve that with FontAwesome, which is already pre-loaded with WooCommerce. Just choose your icon and echo the proper HTML 🙂

      Reply
      1. Thomas
        April 10, 2017

        Hi Rodolfo, thank you very much for you prompt response. Unfortunately, I hadn’t bookmarked this page and had to re-google it – so, sorry for my late appreciation.

        I am a C++ developer and very new to woocommerce and even web development with html, css, etc. – Looking at the FontAwesome webpage, I believe seems to be the “proper HTML” for e.g. a “home” icon.

        Could you please give a hint as to where do we actually put the proper HTML to associate a custom endpoint (like ‘Premium Support’ above) with an icon ?

        My apologies, if the answer to this question is trivial – and thanks again for you help.

        Reply
        1. Rodolfo Melogli
          April 12, 2017

          Hey Thomas! I don’t usually give premium support via blog comments but this time I will do it 🙂 Try adding the call here:

          $items['premium-support'] = 'Premium Support <i></i>';
          

          It might escape the HTML though. Now that I remember I actually used an HTML code instead:

          $items['premium-support'] = 'Premium Support &#8482;';
          
          Reply
  68. osvin
    March 31, 2017

    Hii..Can I add multiple menus by this code. Beacuse i have added some menu & they are showing 404 result even after resaving permalnks.?
    Kindly Help.

    Reply
    1. Rodolfo Melogli
      April 4, 2017

      Hey Osvin thanks for your comment! Yes, you can add multiple tabs, you just have to make sure you add the specific PHP to each PHP snippet and not only the first. Let me know, R

      Reply
    2. Andrea
      June 23, 2017

      Hey Rodolfo. This worked great but I’m not sure I understand what you mean in response to adding multiple tabs. Just adding the code again obviously failed. Any insight to multiple tabs would be great. Thanks!

      Reply
      1. Rodolfo Melogli
        June 23, 2017

        Hey Andrea, I mean duplicating them in this way (inside each snippet) e.g.:

        function bbloomer_add_premium_support_endpoint() {
            add_rewrite_endpoint( 'premium-support', EP_ROOT | EP_PAGES );
            add_rewrite_endpoint( 'other-tab', EP_ROOT | EP_PAGES );
        }
        
        // ETC.
        
        
        Reply
  69. B.Anders
    March 28, 2017

    Hi Rodolfo,
    you are my “to go” for exactly that kind of customization, and this one seems great too. Thank you !

    But, i click save permalinks and instantly get a blank page. Didn’t touch any line in the code and funny, the new tab apeares in my account and i can also go back in the backend in permalinks and hitting save gives me again that blank page. Also if i hit logout in my account i get that white blank page :((
    Any ideas ?

    Reply
    1. B.Anders
      March 28, 2017

      PS .. i rolled back from a backup i made before applying this snippet and the site is ok, permalinks allow saving again… but i need the snippet :((

      Reply
      1. B.Anders
        March 28, 2017

        I love answering my own questions 😀

        I repeated the process and now it works just fine. No way to find out what was wrong the first time, so just another BIG THANK YOU ! Please keep up the good work.

        Reply
        1. Rodolfo Melogli
          March 29, 2017

          Ahah excellent, glad I waited 24hrs before replying 😀

          Reply
  70. Ali
    February 15, 2017

    Hi Rodolfo
    first, thank you
    second, question?
    i put this code into a new plugin,
    plugin adds the “premium-support” tab to the My Account page
    but when I click on it
    it gives me a 404 page error
    can you help me for this??

    Reply
    1. Rodolfo Melogli
      February 22, 2017

      Thank you Ali! Please refresh/resave your permalinks from the WordPress Settings, after that it will work 🙂

      Reply
  71. TJ
    January 19, 2017

    Is it just me, or did this snippet stop working in woocommerce 2.6.13? It used to work on my website, but since the update my custom tabs are hidden on the page 🙁

    Reply
    1. Rodolfo Melogli
      January 19, 2017

      Hey TJ, not sure! Have you tried flushing/re-saving the permalinks?

      Reply
      1. TJ
        January 28, 2017

        Yes I did that – really can’t explain why it does not work. It’s not like I get a 404 error or the classic white screen – everything seems to be fine with the code. But it just won’t show a new tab.

        Reply
        1. TJ
          January 28, 2017

          Ah sorry for that – I just found my rather stupid mistake. I used an array to change the order of the tabs, but forgot to add the new tab to that array.

          Thanks for your help anyway! And great snippet btw.

          Reply
          1. Rodolfo Melogli
            February 8, 2017

            Ah, great! Glad you found that out 🙂 Cheers!

            Reply
          2. Roberto Briceno
            April 18, 2017

            Hi TJ is it possible for you to share how you changed the order of yout tabs? Thanks in advance

            Reply
            1. TJ
              May 1, 2017

              Hi Roberto

              I really don’t know if this is the best way to do it, but it worked for me. Just order the endpoints in the snippet however you need them to be and rename them in your language 🙂

              Cheers
              TJ

               // Changing order
                  
                  function tj_woo_my_account_order() {
                      $myorder = array(
                                       'premium-support' => __( 'Premium Support', 'woocommerce' ),
                                       'edit-account' => __( 'Kontodetails', 'woocommerce' ),
                                       'orders' => __( 'Bestellungen', 'woocommerce' ),
                                       'edit-address' => __( 'Adressen', 'woocommerce' ),
                                       'customer-logout' => __( 'Abmelden', 'woocommerce' ),
                                       );
                      return $myorder;
                  }
                  add_filter ( 'woocommerce_account_menu_items', 'tj_woo_my_account_order' ); 
              Reply
  72. Miroslav
    January 14, 2017

    Hello Rodolfo,

    I wasn’t sure how to do this and went straight to your site and voila – you already wrote a guide for it!

    I was wondering if it’s possible to have that extra tab only shown to those with specific user roles? I would need to restrict the new tab only to 3 users roles. Your input is much appreciated!

    Reply
    1. Rodolfo Melogli
      January 16, 2017

      Hey Miroslav, thanks a lot! Yes, this is of course possible with “conditional logic”. You can get an idea of what I mean by looking at this tutorial https://businessbloomer.com/woocommerce-conditional-logic-ultimate-php-guide/ (it’s missing user roles but you can take a look here for inspiration: https://businessbloomer.com/disable-payment-gateway-specific-user-role-woocommerce/). Hope this helps!

      Reply
  73. Mario
    January 13, 2017

    Hello, nice hook
    I wonder if i want to change the url instead premium-support?
    I tried to change it but no result at all.
    Thank you

    Reply
    1. Rodolfo Melogli
      January 13, 2017

      Hey Mario, thanks so much for your comment! You also need to refresh the permalinks via the dashboard Settings – let me know if that works 🙂

      Reply
      1. Mario
        January 14, 2017

        Thanks for your answer, i already did this but the content is not showing up in the tab.
        It drop me again to the dashboard.

        Reply
        1. Rodolfo Melogli
          January 16, 2017

          Hey Mario, did you change “premium support” in all 4 snippets? This should be changed everywhere in my code, and then you should re-save permalinks. Let me know!

          Reply
  74. Patrick
    November 19, 2016

    Hey Rodolfo,
    thank you for this blog post . That was exactly what I was looking for.
    Works like a charm!

    Just one question: Is is possible to change the arrangement? I would need the tabs I just created by my own first and then the standard WooCommerce orders, download tabs. You know what I mean? Is that possible?

    Reply
    1. Rodolfo Melogli
      November 21, 2016

      Hey Patrick, thanks for your comment! Try adding a priority to the filter e.g.:

      add_filter( 'woocommerce_account_menu_items', 'bbloomer_add_premium_support_link_my_account', 5 );
      

      Let me know if that works 🙂

      Reply
      1. Mike
        January 3, 2017

        Hi, thanks very much for this, it worked for me 🙂

        I did find, though, that the “, 5” technique to place the tab didn’t really work. But I found this link which did the trick: https://wpbeaches.com/change-rename-woocommerce-endpoints-accounts-page/

        Thanks again for the help.

        Reply
        1. Rodolfo Melogli
          January 5, 2017

          Ah, excellent, thanks for your input Mike!

          Reply
  75. Jorge
    November 16, 2016

    Hi Rodolfo, one question, do you have the tabbeb my account page like the one you have?

    Reply
    1. Rodolfo Melogli
      November 16, 2016

      Hey Jorge, thanks for your comment! I’m not sure I fully understand your question, can you rephrase it please? Thanks!

      Reply
      1. Jorge
        November 21, 2016

        Sorry fpr the vague question :$ I was wondering if you have the template files used in your example? I’ve downloaded the ones on github from woocommerce but when I use the template in my theme it doesn’t show like that.

        Reply
        1. Rodolfo Melogli
          November 21, 2016

          Hey Jorge, thanks for your feedback! If I understood correctly, you need to start using WooCommerce 2.6 – that’s when the new Account pages where redesigned 🙂

          Reply
          1. Jorge
            November 25, 2016

            Thanks, but I’ve that version but can’t see the tabbeb dashboard with the icons.

            Reply
            1. Rodolfo Melogli
              November 25, 2016

              Try switching theme temporarily – as that layout comes by default with WooCommerce, so probably your theme is overriding that or is out of date 🙂

              Reply
  76. Great_code
    November 14, 2016

    Thanks. You saved my life. I got stucked with woocommerce plugin for like 8 hours. I though your code doesnt work aswell, but i didnt knew, that there is some magic with permalinks saving. THANKS A LOT!

    Reply
    1. Rodolfo Melogli
      November 14, 2016

      Awesome! Glad to hear that 🙂

      Reply
  77. madboy scatman
    November 9, 2016

    Any chance to tell us where the big code goes?

    Reply
    1. Rodolfo Melogli
      November 9, 2016

      Hey there, yes, sure! You can place this in your child theme’s functions.php file – if you need more guidance, please take a look at this video tutorial: https://businessbloomer.com/woocommerce-customization-hangout/. Thank you 🙂

      Reply
      1. madboy scatman
        November 9, 2016

        I saw before 1 video from you about hooks and was very cool.

        Great joob.
        Your site has been bookmarked

        Reply
        1. Rodolfo Melogli
          November 9, 2016

          Awesome! Thank you!!!

          Reply
      2. madboy scatman
        November 9, 2016

        About the above script.
        Should i copy paste to my fonuctions or i should change something?

        echo do_shortcode( ‘ /* your shortcode here */ ‘ );

        Reply
        1. Rodolfo Melogli
          November 9, 2016

          Well, of course you want to change the “echo” part where you display your content instead of mine, and also the name of the TAB 🙂

          Reply
          1. madboy scatman
            November 9, 2016

            I need some help.
            I tried with that plugin but doesn’t work for mee.

            i added the shortcode [wp_support_plus]

            echo do_shortcode( ' [wp_support_plus] ' );

            The link it is on my account but when i click the link i get redirected to mydomain.com/premium-support/

            Any suggestion?

            Reply
            1. Rodolfo Melogli
              November 9, 2016

              You need to resave permalinks, as per the snippet comments 🙂 Also you need to install the WP support plugin, otherwise the shortcode won’t work!

              Reply
              1. madboy scatman
                November 9, 2016

                I have installed the plugin,created the page and pasted inside the shortcode.

                I got your fonuction (above script) and i pasted to my child theme.
                Also o changed the shortcode at the end of the script.

                Is there anything else to change on the script?

                Regards

                Reply
                1. Rodolfo Melogli
                  November 9, 2016

                  No, but please resave your permalinks from the WordPress settings.

                  Reply
Questions? Feedback? Support? Leave your Comment Now!
_____

If you are writing code, please wrap it between shortcodes: [php]code_here[/php]. Failure to complying with this (as well as going off topic, not writing in English, etc.) will result in comment deletion. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining BloomerArmada to get blog comment reply priority, ask me 1-to-1 WooCommerce questions and enjoy many more perks. Thank you :)

Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts
  • WooCommerce: Related Products Custom Heading & Subheading
  • WooCommerce: Display Stock Status For External Products
  • WooCommerce: Display Product Grid @ Order Emails e.g. Related Products
  • WooCommerce: Capitalize All Product Names
  • WooCommerce: Add a Third Description @ Single Product Page
About Business Bloomer

With 100,000 (and growing) monthly organic sessions, Business Bloomer is the most consistent, most active and most complete WooCommerce development/customization blog.

Of course this website itself uses the WooCommerce plugin, the Storefront theme and runs on a WooCommerce-friendly hosting.

Join 75,000+ Monthly Readers & 16,500+ Subscribers.

Become a Business Bloomer Supporter.

Join BloomerArmada and become an Official Business Bloomer Supporter:
easy-peasy, and lots of perks for you.
See your Benefits →
Popular Searches: Visual Hook Guides - Checkout Page - Cart Page - Single Product Page - Add to Cart - Emails - Shipping - Prices - Hosting
Latest Articles
  • WooCommerce: Related Products Custom Heading & Subheading
  • WooCommerce: Display Stock Status For External Products
  • WooCommerce: Display Product Grid @ Order Emails e.g. Related Products
  • WooCommerce: Capitalize All Product Names
  • WooCommerce: Add a Third Description @ Single Product Page
Latest Comments
  • Rodolfo Melogli on WooCommerce: Separate Login, Registration, My Account Pages
  • Rodolfo Melogli on WooCommerce: Separate Login, Registration, My Account Pages
  • Rodolfo Melogli on WooCommerce: Related Products Custom Heading & Subheading
  • Rodolfo Melogli on WooCommerce: Switch Shop Columns Responsively
Find Out More
  • Become a WooCommerce Expert
  • WooCommerce Blog
  • WooCommerce Online Courses
  • WooCommerce Weekly
  • Bloomer Armada
  • Affiliate Program
  • Contact
Contact Info

Ciao! I’m Rodolfo Melogli, an Italian Civil Engineer who has turned into an international WooCommerce expert. You can contact me here:

Email: [email protected]

Twitter: @rmelogli

Hire me by the hour: Get Quote »

VisaMastercardAmexPayPal Acceptance Mark
Business Bloomer © 2011-2023 - Terms of Use - Privacy Policy