Magento by default displays a huge list of customer account links on the customer account page.
Sometimes we need to customize this default links inclusion as not all links are needed.
There are some sort of requirements to remove some links which are unnecessary for the customers.
Often it’s needed to remove a couple of links, for example, My Product Reviews or Billing Agreements.
Default links on customer account screen :
- Account Dashboard
- Account Information
- Address Book
- My Downloadable Products
- My Orders
- Newsletter Subscriptions
- Stored Payment Methods
- My Product Reviews
- Billing Agreements
- My Wish List
Steps to How to remove navigational links :
Step 1: Create a custom extension or theme and override customer layout file. Create an extension and override the layout XML
file
File Path : app/design/frontend/[Namespace]/[Theme]/Magento_Customer/layout/customer_account.xml
Step 2: Use a tag to remove any extra link from my account
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <!-- Remove unwanted account navigation links --> <!-- Put this file in: app/design/frontend/[Namespace]/[Theme]/Magento_Customer/layout/customer_account.xml --> <!-- Store credit --> <referenceBlock name="customer-account-navigation-customer-balance-link" remove="true"/> <!-- Downloadable product link --> <referenceBlock name="customer-account-navigation-downloadable-products-link" remove="true"/> <!-- Subscription link --> <referenceBlock name="customer-account-navigation-newsletter-subscriptions-link" remove="true"/> <!-- Billing agreement link --> <referenceBlock name="customer-account-navigation-billing-agreements-link" remove="true"/> <!-- Product review link --> <referenceBlock name="customer-account-navigation-product-reviews-link" remove="true"/> <!-- My credit card link --> <referenceBlock name="customer-account-navigation-my-credit-cards-link" remove="true"/> <!-- Account link --> <referenceBlock name="customer-account-navigation-account-link" remove="true"/> <!-- Account edit link --> <referenceBlock name="customer-account-navigation-account-edit-link" remove="true"/> <!-- Address link --> <referenceBlock name="customer-account-navigation-address-link" remove="true"/> <!-- Orders link --> <referenceBlock name="customer-account-navigation-orders-link" remove="true"/> <!-- Wish list link --> <referenceBlock name="customer-account-navigation-wish-list-link" remove="true"/> <!-- Gift card link --> <referenceBlock name="customer-account-navigation-gift-card-link" remove="true"/> <!-- Order by SKU --> <referenceBlock name="customer-account-navigation-checkout-sku-link" remove="true"/> <!-- Gift registry --> <referenceBlock name="customer-account-navigation-giftregistry-link" remove="true"/> <!-- Reward points --> <referenceBlock name="customer-account-navigation-reward-link" remove="true"/> </body> </page> |
Step 3: Clear cache and check the My Account page.
The link which we have removed using tag remove="true"
will no longer be displayed on your “My account page”.
Happy Coding. Keep Liking & Sharing