{"id":411,"date":"2019-05-10T10:58:21","date_gmt":"2019-05-10T10:58:21","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2019\/05\/10\/add-custom-tab-in-customer-account-dashboard-in-magento-2\/"},"modified":"2025-05-22T16:52:58","modified_gmt":"2025-05-22T11:22:58","slug":"add-custom-tab-in-customer-account-dashboard-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/add-custom-tab-in-customer-account-dashboard-in-magento-2\/","title":{"rendered":"How to Add Custom Tab in Customer Account Dashboard in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The default Magento 2 store redirects the user to &#8220;My Account&#8221; section after sign up or login. Here, you can find various default tabs like My Account, My Orders, My Wishlist, etc. Hence, at this point, the store owners may want to offer various features that help the visitors to go through their shopping easily. For example, the customers can request a refund of a product, check the demo product, take a look at the quote they requested and any other custom requirements!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Unfortunately, the default Magento 2 does not offer the luxury of such features. It&#8217;s the task of developers to <i><strong>add custom tab in customer account dashboard in Magento 2<\/strong><\/i>. Likewise you can also hide unnecessary tabs in product page in frontend. And for that you need to <a title=\"How to Hide an Empty Custom Tab in Magento 2\" href=\"https:\/\/meetanshi.com\/blog\/hide-empty-custom-tab-in-magento-2\/\">hide a empty custom tab in Magento 2<\/a> so that your customers don&#8217;t get distract from their main goal i.e., make purchase. Follow the below method to add a custom tab in customer &#8220;My Account&#8221; section in your Magento 2 store!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps to Add Custom Tab in Customer Account Dashboard in Magento 2:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">1. Create <strong>customer_account.xml<\/strong> in path <em><strong>Vendor\/Module\/view\/frontend\/layout<\/strong><\/em><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;page xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd\">\n   &lt;body>\n      &lt;referenceBlock name=\"customer_account_navigation\">\n         &lt;block class=\"Magento\\Framework\\View\\Element\\Html\\Link\\Current\" name=\"customer-account-navigation-custom\">\n            &lt;arguments>\n               &lt;argument name=\"path\" xsi:type=\"string\">routename\/customer\/index&lt;\/argument>\n               &lt;argument name=\"label\" xsi:type=\"string\">My Custom Tab&lt;\/argument>\n            &lt;\/arguments>\n         &lt;\/block>\n      &lt;\/referenceBlock>\n   &lt;\/body>\n&lt;\/page><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2. Create&nbsp;<strong>routename_customer_index.xml<\/strong>&nbsp;in path&nbsp;<strong><em>Vendor\/Module\/view\/frontend\/layout<\/em><\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;page xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"..\/..\/..\/..\/..\/..\/..\/lib\/internal\/Magento\/Framework\/View\/Layout\/etc\/page_configuration.xsd\"> \n&lt;update handle=\"customer_account\"\/> \n&lt;body> \n    &lt;referenceBlock name=\"page.main.title\"> \n            &lt;action method=\"setPageTitle\"> \n                &lt;argument translate=\"true\" name=\"title\" xsi:type=\"string\">My Custom Tab&lt;\/argument> \n            &lt;\/action> \n     &lt;\/referenceBlock> \n     &lt;referenceContainer name=\"content\"> \n        &lt;block class=\"Magento\\Framework\\View\\Element\\Template\" name=\"my_tab\" template=\"Vendor_Module::mytab.phtml\"> \n        &lt;\/block> \n    &lt;\/referenceContainer> \n&lt;\/body> \n&lt;\/page><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3. Create&nbsp;<strong>Index.php<\/strong>&nbsp;in path&nbsp;<em><em><strong>Vendor\/Module\/Controller\/Customer<\/strong><\/em><\/em><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php \nnamespace Vendor\/Module\\Controller\\Customer;  \nclass Index extends \\Magento\\Framework\\App\\Action\\Action { \n  \n public function execute() { \n  \n    $this->_view->loadLayout(); \n    $this->_view->renderLayout(); \n  } \n  \n} \n?><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">4. Create&nbsp;<strong>mytab.phtml<\/strong>&nbsp;in path&nbsp;<em><em><strong>Vendor\/Module\/view\/frontend\/templates<\/strong><\/em><\/em><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php \n \/\/ Add Some Code Here for design\n?>\n&lt;span> My Custom Tab.. &lt;\/span><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Ain&#8217;t that easy?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Moreover, if you want to <a href=\"https:\/\/meetanshi.com\/blog\/remove-unnecessary-customer-account-links-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">remove unnecessary customer account links in Magento 2<\/a>, check the solution in our blog post.<br>Also, if you want to collect additional information from the customers, you can <a title=\"How to Create a Tab and Load Grid in Magento 2 Customer Admin Edit Page\" href=\"https:\/\/meetanshi.com\/blog\/create-a-tab-and-load-grid-in-magento-2-customer-admin-edit-page\/\" target=\"_blank\" rel=\"noopener\">create a tab and load grid in Magento 2 customer admin edit page<\/a>. Also you can <a title=\"How to Dynamically Add Link to Customer Account Navigation in Magento 2\" href=\"https:\/\/meetanshi.com\/blog\/dynamically-add-link-to-customer-account-navigation-in-magento-2\/\">add customer account navigation in Magento 2 dynamically<\/a> it allows you to customize and enhance the customer\u2019s account dashboard by adding custom links or sections based on specific business needs and requirements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not forget to appreciate the post with 5 stars if it helped you customize your Magento 2 store&#8217;s &#8220;My Account&#8221; dashboard for your valuable customers!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The default Magento 2 store redirects the user to &#8220;My Account&#8221; section after sign up or login. Here, you can find various default tabs like&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-411","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=411"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/411\/revisions"}],"predecessor-version":[{"id":15434,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/411\/revisions\/15434"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}