Many WooCommerce websites don’t need the “Downloads” tab in the My Account page. Or maybe the “Addresses” tab needs to be renamed into something more user-friendly π
Well, here are 2 super simple snippets to hide or rename any tabs you have in the My Account page, including custom tabs that are added by plugins such as Account Funds, Subscriptions, and so on.
Simply note down the URL of the tab e.g. “edit-account” (see image) and edit the snippets accordingly. Enjoy!
PHP Snippet: Hide or Rename a My Account Tab – WooCommerce
/**
* @snippet Hide Edit Address Tab @ My Account
* @how-to Get CustomizeWoo.com FREE
* @author Rodolfo Melogli
* @testedwith WooCommerce 5.0
* @community https://businessbloomer.com/club/
*/
add_filter( 'woocommerce_account_menu_items', 'bbloomer_remove_address_my_account', 9999 );
function bbloomer_remove_address_my_account( $items ) {
unset( $items['edit-address'] );
return $items;
}
/**
* @snippet Rename Edit Address Tab @ My Account
* @how-to Get CustomizeWoo.com FREE
* @author Rodolfo Melogli
* @testedwith WooCommerce 5.0
* @community https://businessbloomer.com/club/
*/
add_filter( 'woocommerce_account_menu_items', 'bbloomer_rename_address_my_account', 9999 );
function bbloomer_rename_address_my_account( $items ) {
$items['edit-address'] = 'Delivery Address';
return $items;
}
If you need the full list of default account menu item keys, here they are:
$items = array(
'dashboard' => __( 'Dashboard', 'woocommerce' ),
'orders' => __( 'Orders', 'woocommerce' ),
'downloads' => __( 'Downloads', 'woocommerce' ),
'edit-address' => _n( 'Addresses', 'Address', (int) wc_shipping_enabled(), 'woocommerce' ),
'payment-methods' => __( 'Payment methods', 'woocommerce' ),
'edit-account' => __( 'Account details', 'woocommerce' ),
'customer-logout' => __( 'Logout', 'woocommerce' ),
);
If PHP fails… Remove an Endpoint from WooCommerce Settings
Go to WordPress Dashboard > WooCommerce > Settings > Advanced, and look for “Account endpoints”.
For example, the official Memberships plugin adds a “Memberships” tab to your My Account page which is controlled by the endpoint “members-area”.
Delete this endpoint from the text input field, click on “Save changes”, flush your permalinks, and the “Memberships” tab will be deleted. Be really careful with these endpoints, and only delete them if you know what you’re doing.
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 removing or renaming 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 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 π
Yes the code still works thanks.
Nice!
I used your snippet to unset a couple endpoints and then decided to comment one of those unsets out – to try to bring it back.
However, for w/e reason the endpoint will not show up again unless I completely disable the snippet. Is there something I need to flush?
Additionally, would it be possible somehow to unset those menu items conditionally based on the endpoint (i.e if you’re on edit_addresses endpoint then unset a, b, c menu items)?
Did you try refreshing/resaving permalinks?
Hello
The code still works by September 2021.
Thank you so much for all your snippets, they are life saving!
Thanks!
The filters don’t seem to be working any more. Woocommerce 4.7, 4.8
The endpoints still work, but not the useful Account Tab filters
Just checked, filter still exists and should work
Thanks Rodolfo, very neat and direct way to remove unwanted tabs.
One small problem though: having hidden away tabs for products & address – the default greeting under ‘Dashboard’ retains a link to them: “From your account dashboard you can view your recent orders, manage your shipping and billing addresses, and edit your password and account details.”
Could you please point me towards where I could edit this message? I’ve been using ‘Say What’ plugin in other areas – but not sure if that’s the best approach here. Thanks.
Hey Mike this should help https://www.businessbloomer.com/translate-single-string-woocommerce-wordpress/
Thanks so much for this, just saved my ass π
Cool
Thanks a lot Rodolfo for your assistance…
I want my-account menu to display horizontally and in-line not the default vertical position. Is there a snippet that could change that.
Hi Mishael, 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!
You need to do this in CSS, it’s very stragihtforward
Hi, all your code snippets look really useful and considering the comments, I thought it would be very easy. And yet, when I add the code snippet from this article, nothing changes on my site. I have WordPress 5.4.2, WooCommerce 4.1.1, PHP 7.4 and the FlatSome theme (child theme enabled of course). I tested many other code snippets, nothing worked and yet the child theme came “read” since my site crashes when I deliberately add a synthax error inside the code snippets.
Please help me ! π
Hey Tibere, try switch to another theme to test it. If it works, then this snippet needs to be adjusted for Flatsome
Thanks Rodolfo,
The php hook cleaned up my 3rd party plugin that didn’t give me an option to not add their plugin dashboard to my-account.
Problem solved.
Nice!
Wonderful website – so clear and straightforward! Thank you!
It works well, except I can’t figure out how to change the name of “My Subscriptions” in your snippet. The URL is …account/view-subscription/100987/ so the path is for a specific subscription that will be different for everyone. The answer might be obvious but I am not great with PHP.
Uhm, not sure, did you ask the Subscriptions plugin developers?
hi
When clicking on “orders” you see on the next pages that you can cancel subscription.
I like to remove this link as I want it elsewhere. How is that done?
Hello 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. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding! ~R
Thank you for this post man!! I’ve learned a lot with you! I have a question:
Instead of use my theme functions.php I’ve created a Theme-child folder and added a functions.php and style.css as well.
This is my new function.php
But changes are not being showed up. If I change my theme functions.php I can see my changes but with the Child theme I can't see it. What is wrong?
Cezar, thanks so much for your comment! I just retested this on the latest version of WooCommerce and it still works. Unfortunately this looks like custom troubleshooting work and I cannot help here via the blog comments. Thanks a lot for your understanding! ~R
Looks like maybe an update to WooCommerce has removed the Endpoints settings from Settings > Account.
I was wanting to remove the Memberships from the My Account page. I ended up using this:
Nice! π
This snippet is working great, but I am also not able to remove membership, and the code from Bet generated some errors – just a heads up. Is there a modification of the original snippet that might work for to remove the Membership tab?
I’ve fixed Bet’s snippet, try again
This was a great help to get rid of Downloads just as you suggested. Worked perfectly. Thanks.
Excellent π
I just deleted the endpoint Downloads and it disappeared from the account page, no coding required π
Nice, thanks Danny π
Yet another awesome Woocommerce snippet!
Since my store is digital products (downloads), the Address tab is unnecessary. So it was nice to ditch it. Even makes the My Account page look a little better.
Code worked perfectly. Thank you π
If you need any idea’s, any code that better allows working with customers in Woocommerce, I am sure many would find useful. The biggest lack with WC.
Ron
Thank you Ron π