Removing Customer Account Sidebar Links in Magento 2

Removing Customer Account Sidebar Links in Magento 2

To customize the Magento 2 customer dashboard, you can remove unwanted navigation links from the sidebar by modifying the customer_account.xml layout file.

Removing Customer Account Sidebar Links in Magento 2

To remove specific customer navigation links from the Magento 2 dashboard, you can modify the customer_account.xml layout file. This approach allows you to tailor the customer account sidebar to better fit your store's needs.

Steps to Remove Customer Account Navigation Links in Magento 2

Locate or Create the Layout File:

  • Navigate to your theme's directory:
  • app/design/frontend/{VendorName}/{ThemeName}/Magento_Customer/layout/

  • If the customer_account.xml file doesn't exist, create it.

Edit the customer_account.xml File:

  • Open the file and add the following XML code to remove unwanted links:
  • <?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 specific account navigation links -->

    <!-- Example: Remove My Orders link -->

    <referenceBlock name="customer-account-navigation-orders-link" remove="true"/>

    <!-- Add more links to remove as needed -->

    </body>

    </page>

  • Replace customer-account-navigation-orders-link with the block name of the link you wish to remove.

Common Customer Account Navigation Links and Their Block Names

Here's a list of default customer account links in Magento 2 and their corresponding block names:

Link Name Block Name
My Account customer-account-navigation-account-link
Account Information customer-account-navigation-account-edit-link
Address Book customer-account-navigation-address-link
My Orders customer-account-navigation-orders-link
My Downloadable Products customer-account-navigation-downloadable-products-link
My Wish List customer-account-navigation-wish-list-link
My Product Reviews customer-account-navigation-product-reviews-link
Newsletter Subscriptions customer-account-navigation-newsletter-subscriptions-link
Billing Agreements customer-account-navigation-billing-agreements-link
Stored Payment Methods customer-account-navigation-my-credit-cards-link

Important Considerations

  • Backup: Always back up your theme files before making modifications.
  • Backup: Always back up your theme files before making modifications.
  • Testing: Verify changes in a development environment before applying them to your live site.

By customizing the customer account navigation, you can enhance user experience and streamline account management for your customers.

Tip

To enhance your eCommerce store’s performance with Magento, focus on optimizing site speed by utilizing Emmo themes and extensions. These tools are designed for efficiency, ensuring your website loads quickly and provides a smooth user experience. Start leveraging Emmo's powerful solutions today to boost customer satisfaction and drive sales!

FAQs

How Can I Remove Customer Navigation Links in Magento 2?

You can remove specific customer navigation links from the account sidebar by modifying the customer_account.xml file and using the <referenceBlock name="LINK_BLOCK_NAME" remove="true"/> node.

Where Is the customer_account.xml File Located?

You can find the file at the following path:

app/design/frontend/{VendorName}/{ThemeName}/Magento_Theme/view/frontend/layout/customer_account.xml

What Is an Example of Removing a Navigation Link?

To remove the "My Product Reviews" link, add this code inside customer_account.xml:


<referenceBlock name="customer-account-navigation-product-reviews-link" remove="true"/>
        

What Customer Navigation Links Can Be Removed?

You can remove any of the following links from the customer dashboard:

  • My Account
  • Address Book
  • Account Information
  • My Downloadable Products
  • Newsletter Subscriptions
  • My Orders
  • My Wish List

Can I Remove Magento Commerce-Specific Links?

Yes, if you're using Magento Commerce, you can also remove these links:

  • Order by SKU
  • Store Credit
  • Gift Card
  • Gift Registry
  • Reward Points
  • My Returns

What Happens If I Remove a Navigation Link?

Once a link is removed from customer_account.xml, it will no longer appear in the customer dashboard sidebar. The corresponding section will still exist, but customers won't be able to navigate to it from the sidebar.