Skip to content

Instantly share code, notes, and snippets.

@matt-bailey
Last active July 3, 2023 23:10
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save matt-bailey/3a5b36186a599b8653bb3b05115ecd90 to your computer and use it in GitHub Desktop.
Save matt-bailey/3a5b36186a599b8653bb3b05115ecd90 to your computer and use it in GitHub Desktop.
Disable My Account sidebar links in Magento 2
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<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"/>
<!-- Delimiters -->
<referenceBlock name="customer-account-navigation-delimiter-0" remove="true"/>
<referenceBlock name="customer-account-navigation-delimiter-1" remove="true"/>
<referenceBlock name="customer-account-navigation-delimiter-2" remove="true"/>
</body>
</page>
@matt-bailey
Copy link
Author

Simply put this file in app/design/frontend/[Namespace]/[Theme]/Magento_Customer/layout/customer_account.xml. Comment out the ones you still want to display.

@MageryThemes
Copy link

MageryThemes commented Apr 7, 2017

We created a simple extension that allows to manage customer account links from admin (remove/rename/reorder).

@refaelgold
Copy link

Great! Thanks!

@jeroenalewijns
Copy link

Nice, thanks!
Maybe the delimiters can also be added:

<!-- Delimiters -->
<referenceBlock name="customer-account-navigation-delimiter-0" remove="true"/>
<referenceBlock name="customer-account-navigation-delimiter-1" remove="true"/>
<referenceBlock name="customer-account-navigation-delimiter-2" remove="true"/>

@matt-bailey
Copy link
Author

Thanks @jeroenalewijns, added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment