One of the features of Business Bloomer Club 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 🙂
PHP Snippet: How to Add a New Tab @ WooCommerce My Account Page
/**
* @snippet WooCommerce Add New Tab @ My Account
* @how-to businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 5.0
* @community https://businessbloomer.com/club/
*/
// ------------------
// 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 🙂
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
Thanks Si! That should not happen. Did you use the exact same code?
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…
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
I added this code to the website but when I click on the custom tab it redirects to a not found page.
Did you save WordPress permalinks?
Thanks for a great tip. This helped me exactly as I needed.
Great!
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.
Nope. Did you refresh permalinks?
Add
after
and the 404 error will disappear without having to refresh the permalinks.
Fantastic
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…
Maybe at plugin level this is not needed. Give it a go
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?
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
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
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!
Custom Work? Seriously? Its a simple single line to add to the snippet already provided, add to each function
change $vars to $items or remove variable if none are returned. Easy
Thanks for your feedback Kent, but take it easy ah
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
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!
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
Thanks for your feedback Kent
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:
I share in case it helps somebody else.
Cheers Alain!
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.
Did you save permalinks?
What is to save permalinks? How do I save permalinks?
Go to “permalinks” in your WP admin and hit “Update”
Great post!!! It worked perfectly, thank you very much.
Nice!
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?
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!
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?
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!
sir i need your help, how to move to the bottom logout tab
thanks alot sir
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!
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.
Yes totally possible inside the same functions
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?
Never mind. The issue is solved.
Nice!
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:
Nice!
So much love for this one!
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?
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!
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:
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!
Nice!
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:
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!
ah never mind, I just resave permalink after I change the slug.
Eheh great
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.
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!
the answer to this question is given in this excellent article :
https://www.businessbloomer.com/woocommerce-move-reorder-my-account-tabs/
😉
Hi Rodolfo. I inserted exactly the same code as yours but it’s not working. Can you please give me a light? Thanks
Can you switch temporarily to 2020 theme and see if it works there?
It worked fine for me. I did have to refresh my permalinks though. Thanks!
Cool
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.
I don’t work with multisite so I can’t help you, sorry
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 ))
Great!
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.
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!
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?
Yes, you can do that within the same functions – just add new lines to them 🙂
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?
Yes Joseph, this is quite specific, so you’ll need to customize either the shortcode or maybe set up custom .htaccess redirects
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} ?
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!
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
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
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?
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.
Hi there – ask YITH support please
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?
That might be the problem, yes
I am getting 404 error when open the custom link. Please help me
Please resave your permalinks
I am also not able open the premium support tab.
page not found is the error occuring .
I also tried to resave permalink file
Please copy/paste your code in here:
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?
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!
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?
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
HELLO
please i will like to add upload file on my woocommerce registeration form please any help
thanks
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
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.
Awesome 🙂
It’s not working for me in the latest version of Wocommerce 3.4.7
Hey there, it works for me 🙂 Can you try with another theme and only WooCommerce plugin active please?
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
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!
Thanks again for your article! i could not make it without! 🙂
Nice 🙂
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.
Good point Giancarlo!
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.
Hey Sunny – thanks so much for your comment! That should already work like that 🙂
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
Nice – thanks so much for your comment “Undefined person” 😀
The snippet is not working. I am using the latest version of woocommerce
Hey there, thanks for your feedback! If you temporarily switch to 2017 theme, does the snippet work?
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
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
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?
Not a good idea Latheesh, you only need to flush the permalinks once 🙂
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:
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! 🙂
Awesome stuff Sharon, thanks! 🙂
Still working, you should make the SAVE PERMALINKS AGAIN notice a bit larger. It caught me out at the start!
Thanks for the code!!
Awesome 🙂
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.
No problem at all Sebastien. Go to “/wp-admin/options-permalink.php” and click on “Save Changes” 🙂
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?
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!
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!
Excellent 🙂
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?
Hi Rodolfo, I DID do something wrong. Luckily I found out what it was.
Thanks so much for your code and instructions!
Regards, Elisabeth
Excellent 🙂
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?
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
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.
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?
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:
Great job! It worked for me!
Thanks a lot!
Great 🙂
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
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
hi
this worked bottom of logout
how can change priority of tab??
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
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 .
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
hi
where we put add filter function
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!
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
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!
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
Yes Reese, I guess they’re your best bet 🙂
There’s another thing that can be added.
Thanks.
Thanks Shazzad 🙂
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.
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
Hi Rodolfo,
How do I point the new tab to an URL instead ?
Hey Diederik, thanks for your comment! I suggest using https://wordpress.org/plugins/simple-301-redirects/
I’m getting 404 error. Double check code, deactivated all plugins but no success.
Hey Sehrish, go to Settings > Permalinks > “Save Changes”. That will fix it 🙂
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.
Radoslav, thanks for your comment! So, you want to have a redirect? Maybe use the Simple 301 plugin for that 🙂
I just searching what exactly “support ticket” system for woocommerce and you wrote exactly what i want to do. Thank you so much
Ah, awesome Ahmet! 🙂
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.
Thanks Mark! Do you have a screenshot to help me understand?
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
Thanks for your comment Matt! I use https://wordpress.org/plugins/wp-support-plus-responsive-ticket-system/ 🙂
thank you.
i get 404 err,fix with re save permalink setting.
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 🙂
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.
Hey!
Great snippet.
How would I go about making the endpoint page specific to a select user or user role?
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 🙂
Your custom tab also displays a custom icon, would you mind explaining, how this can be accomplished ?
Thank you very much in advance!
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 🙂
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.
Hey Thomas! I don’t usually give premium support via blog comments but this time I will do it 🙂 Try adding the call here:
It might escape the HTML though. Now that I remember I actually used an HTML code instead:
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.
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
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!
Hey Andrea, I mean duplicating them in this way (inside each snippet) e.g.:
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 ?
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 :((
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.
Ahah excellent, glad I waited 24hrs before replying 😀
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??
Thank you Ali! Please refresh/resave your permalinks from the WordPress Settings, after that it will work 🙂
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 🙁
Hey TJ, not sure! Have you tried flushing/re-saving the permalinks?
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.
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.
Ah, great! Glad you found that out 🙂 Cheers!
Hi TJ is it possible for you to share how you changed the order of yout tabs? Thanks in advance
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
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!
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!
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
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 🙂
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.
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!
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?
Hey Patrick, thanks for your comment! Try adding a priority to the filter e.g.:
Let me know if that works 🙂
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.
Ah, excellent, thanks for your input Mike!
Hi Rodolfo, one question, do you have the tabbeb my account page like the one you have?
Hey Jorge, thanks for your comment! I’m not sure I fully understand your question, can you rephrase it please? Thanks!
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.
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 🙂
Thanks, but I’ve that version but can’t see the tabbeb dashboard with the icons.
Try switching theme temporarily – as that layout comes by default with WooCommerce, so probably your theme is overriding that or is out of date 🙂
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!
Awesome! Glad to hear that 🙂
Any chance to tell us where the big code goes?
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 🙂
I saw before 1 video from you about hooks and was very cool.
Great joob.
Your site has been bookmarked
Awesome! Thank you!!!
About the above script.
Should i copy paste to my fonuctions or i should change something?
echo do_shortcode( ‘ /* your shortcode here */ ‘ );
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 🙂
I need some help.
I tried with that plugin but doesn’t work for mee.
i added the 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?
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!
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
No, but please resave your permalinks from the WordPress settings.