How to Remove Unnecessary Customer Account Links in Magento 2
The default Magento 2 “My Account” section offers a number of tabs such as
- Account Dashboard
- Account Information
- Address Book
- My Downloadable Products
- My Orders
- Newsletter Subscriptions
- Stored Payment Methods
- My Product Reviews
- Billing Agreements
- My Wish List
Previously, I had discussed how to add Custom Tab in Customer Account Dashboard in Magento 2 to add custom tabs in My Account section for the specific requirements.
Customers seem to be cleanliness freak! 😄
And thus, Sometimes we need to customize the code to exclude unnecessary links as not all links are needed.
I’ll help you remove unnecessary customer account links in Magento 2 to manage the “My Account” section. Implementing this in your store, you are making sure that customers can easily navigate and find the exact things they want faster. Improve the customer experience and offer an easy-to-use customer account dashboard for Magento 2!
Follow the below code for easy Magento 2 Customer Account Links Manager!
Method to Remove Unnecessary Customer Account Links in Magento 2:
Create customer_account.xml file at app\code\Vendor\Extension\view\frontend\layout\
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <!--remove newsletter tab--> <referenceBlock name="customer-account-navigation-newsletter-subscriptions-link" remove="true"/> <!--remove wishlist tab--> <referenceBlock name="customer-account-navigation-wish-list-link" remove="true"/> <!--remove review tab--> <referenceBlock name="customer-account-navigation-product-reviews-link" remove="true"/> </body> </page> |
That’s it. Implementing this, the customer account dashboard looks something like this where the links to Newsletter Subscription, Wish lIst, and Product Reviews are absent:
As per your business requirements, you can implement this method to remove the unnecessary tabs in Magento 2. For example, if you are not offering a newsletter, for now, remove the Newsletter subscription link altogether.
An easy to follow method, however, feel free to post any doubts on the topic in the Comments section below and I’d be happy to help 🙂
Thanks!
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
2 Comments
I found just what I was looking for.
You have ended my four-day lengthy hunt!
Have a great day.
Bye
Thanks Isabelle!