When working with Magento, you may find some unnecessary links that should be removed from your Magento backend. In this tutorial for beginner, we’re going to learn how to remove customer account links in the menu, you can also do the same to other menu links.

In this tutorial, we will learn how to remove the Recurring Profiles link in My Account drop-down menu.
This link is added by XML layout declaration in app/design/frontend/base/default/layout/sales/recurring_profile.xml:
1 2 3 4 5 6 7 8 9 | <customer_account> <reference name="customer_account_navigation" > <action method="addLink" translate="label"> <name>recurring_profiles</name> <path>sales/recurring_profile/</path> <label>Recurring Profiles</label> </action> </reference> </customer_account> |
1. CREATE OUR CUSTOM MODULE
First things first, we need to create and declare and module.
Create app/etc/modules/Acme_Module.xml. This will tell Magento about the Module that contains our rewritten class.
1 2 3 4 5 6 7 8 9 | <?xml version="1.0"?> <config> <modules> <Acme_Module> <active>true</active> <codePool>local</codePool> </Acme_Module> </modules> </config> |
2. CREATE APP/CODE/LOCAL/ACME/MODULE/ETC/CONFIG.XML
Next, we will tell Magento where to find the module. Now, create app/code/local/Acme/Module/etc/config.xml and insert the following code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <?xml version="1.0"?> <config> <modules> <Acme_Module> <version>0.0.1</version> </Acme_Module> </modules> <global> <blocks> <customer> <rewrite> <account_navigation>Acme_Module_Block_Account_Navigation</account_navigation> </rewrite> </customer> </blocks> </global> </config> |
3. INSTALL APP/CODE/LOCAL/ACME/MODULE/BLOCK/ACCOUNT/NAVIGATION.PHP
Now, install this in app/code/local/Acme/Module/Block/Account/Navigation.php:
1 2 3 4 5 6 7 8 9 10 11 | <?php class Customer_Account_Navigation_Llink extends Mage_Customer_Block_Account_Navigation { public function removeLinkByName($name) { unset($this->_links[$name]); return $this; } } |
4. REMOVE LINK WITH LOCAL.XML
After you’re done the 3 steps above, just add this to our local.xml to remove link
1 2 3 4 5 6 7 | <customer_account> <reference name="customer_account_navigation"> <action method="removeLinkByName"> <name>recurring_profiles</name> </action> </reference> </customer_account> |
The name argument can be determined by finding the name as described in the original XML files where addLink was called.
If you have any questions or feedback, feel free to drop a comment.
Happy coding!