{"id":3340,"date":"2022-07-23T10:56:40","date_gmt":"2022-07-23T10:56:40","guid":{"rendered":"https:\/\/www.cynoinfotech.com\/?p=3340"},"modified":"2026-04-16T13:32:11","modified_gmt":"2026-04-16T13:32:11","slug":"how-to-add-a-custom-tab-in-my-account-section-in-magento-2","status":"publish","type":"post","link":"https:\/\/cynoinfotech.com\/blog\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\/","title":{"rendered":"How to add a custom tab myAccount section in  Magento 2"},"content":{"rendered":"<p>In Magento 2, when customer login to the website, he is given the My Account option on the right side. Clicking on it opens the Myaccount section. In this blog, we are going to explain how to add additional tabs to that section.<\/p>\n<p>Why is it important to add custom tabs?\u00a0 Because to get some additional information of customers. To show a demo of a new product. A custom tab is created for another such additional requirement.<\/p>\n<p>It is very easy to make a custom tab see this step:-<\/p>\n<p>\u21d2 You have to create the file <em><strong>customer_account.xml<\/strong><\/em> in this path <em><strong>Vendorname\/Modulename\/view\/frontend\/layout<\/strong><\/em><\/p>\n<pre class=\"lang:default decode:true\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;page xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" \n   xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd\"&gt;\n    &lt;body&gt;\n        &lt;referenceBlock name=\"customer_account_navigation\"&gt;\n            &lt;block class=\"Magento\\Framework\\View\\Element\\Html\\Link\\Current\" \n               name=\"mobile-number-tab-link\" cacheable=\"false\"&gt;\n                &lt;arguments&gt;\n                    &lt;argument name=\"path\" xsi:type=\"string\"&gt; routename\/customer\/index&lt;\/argument&gt;\n                    &lt;argument name=\"label\" xsi:type=\"string\"&gt;Custom Tab Name&lt;\/argument&gt;\n                &lt;\/arguments&gt;\n            &lt;\/block&gt;\n        &lt;\/referenceBlock&gt;\n    &lt;\/body&gt;\n&lt;\/page&gt;\n<\/pre>\n<p>\u21d2 You have to create \u00a0file\u00a0 <em><strong>routename _customer_index.xml<\/strong> <\/em>\u00a0in this path <strong><em>Vendorname\/Modulename\/view\/frontend\/layout\u00a0<\/em><\/strong><\/p>\n<pre class=\"lang:default decode:true \">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;page xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"..\/..\/..\/..\/..\/..\/..\/lib\/internal\/Magento\/Framework\/View\/Layout\/etc\/page_configuration.xsd\"&gt; \n    &lt;update handle=\"customer_account\"\/&gt; \n    &lt;body&gt; \n        &lt;referenceBlock name=\"page.main.title\"&gt; \n            &lt;action method=\"setPageTitle\"&gt; \n                &lt;argument translate=\"true\" name=\"title\" xsi:type=\"string\"&gt; Custom Tab Name &lt;\/argument&gt; \n            &lt;\/action&gt; \n        &lt;\/referenceBlock&gt; \n        &lt;referenceContainer name=\"content\"&gt; \n            &lt;block class=\"Magento\\Framework\\View\\Element\\Template\" name=\"custom-tab-link\" template=\" Vendorname_Modulename::customer\/account\/customtab.phtml\" cacheable=\"false\"\/&gt;\n        &lt;\/referenceContainer&gt; \n    &lt;\/body&gt; \n&lt;\/page&gt;\n<\/pre>\n<p>\u21d2\u00a0 You have to create \u00a0file\u00a0<em><strong> routes.xml<\/strong><\/em> in this path <strong><em>Vendorname\/Modulename\/etc\/frontend<\/em><\/strong><\/p>\n<pre class=\"lang:default decode:true \">&lt;?xml version=\"1.0\" ?&gt;\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:App\/etc\/routes.xsd\"&gt;\n    &lt;router id=\"standard\"&gt;\n        &lt;route frontName=\"custaccounttab\" id=\"custaccounttab\"&gt;\n            &lt;module name=\" Vendorname_Modulename \"\/&gt;\n        &lt;\/route&gt;\n    &lt;\/router&gt;\n&lt;\/config&gt;\n<\/pre>\n<p>\u21d2 \u00a0You have to create \u00a0file\u00a0<em><strong> Index.php<\/strong> <\/em>\u00a0in this path <strong><em>Vendorname\/Modulename\/Controller\/Customer<\/em><\/strong><\/p>\n<pre class=\"lang:default decode:true \">&lt;?php\n \nnamespace Vendorname\\Vendorname \\Controller\\Customer;\n \nclass Index extends \\Magento\\Framework\\App\\Action\\Action \n{\n    public function execute() \n    {\n        $this-&gt;_view-&gt;loadLayout();\n        $this-&gt;_view-&gt;renderLayout();\n    }\n}\n<\/pre>\n<p>\u21d2 You have to create \u00a0file\u00a0<strong><em> customtab.phtml<\/em><\/strong> \u00a0in this path <strong><em>Vendorname\/Modulename\/ view\/frontend\/templates\/customer\/account<\/em><\/strong><\/p>\n<pre class=\"lang:default decode:true \">&lt;?php \n \n\/\/ Add your tab content here.\necho \"This is a custom tab \";\n<\/pre>\n<p>Then you should do this commend <strong>php -dmemory_limit=2G bin\/magento cache:flush<\/strong> and see the custom tab has successfully landed in the myAccount section. i hope you have to understand this blog.if you have any questions let me know in comment section<\/p>\n<p><strong>Thank You\u00a0 :\u232a<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Magento 2, when customer login to the website, he is given the My Account option on the right side. Clicking on it opens the Myaccount section. In this blog, we are going to explain how to add additional tabs to that section. Why is it important to add custom tabs?\u00a0 Because to get some [&hellip;]<\/p>\n","protected":false},"author":670,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3340","post","type-post","status-publish","format-standard","hentry","category-magento-blog"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to add a custom tab myAccount section in Magento 2 - cynoinfotech<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cynoinfotech.com\/blog\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\/\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\\\/\"},\"author\":{\"name\":\"Arjun Makadiya\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#\\\/schema\\\/person\\\/f1be8186602d3ebf417cf58baf125f24\"},\"headline\":\"How to add a custom tab myAccount section in Magento 2\",\"datePublished\":\"2022-07-23T10:56:40+00:00\",\"dateModified\":\"2026-04-16T13:32:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\\\/\"},\"wordCount\":225,\"publisher\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#organization\"},\"articleSection\":[\"Magento blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\\\/\",\"url\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\\\/\",\"name\":\"How to add a custom tab myAccount section in Magento 2 - cynoinfotech\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#website\"},\"datePublished\":\"2022-07-23T10:56:40+00:00\",\"dateModified\":\"2026-04-16T13:32:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to add a custom tab myAccount section in Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/\",\"name\":\"cynoinfotech\",\"description\":\"web design &amp; development\",\"publisher\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#organization\",\"name\":\"Cynoinfotech\",\"url\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.cynoinfotech.com\\\/wp-content\\\/uploads\\\/2017\\\/11\\\/final-logo-ci.png\",\"contentUrl\":\"https:\\\/\\\/www.cynoinfotech.com\\\/wp-content\\\/uploads\\\/2017\\\/11\\\/final-logo-ci.png\",\"width\":240,\"height\":70,\"caption\":\"Cynoinfotech\"},\"image\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/cynoinfotech\\\/\",\"https:\\\/\\\/x.com\\\/cynoinfotech\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#\\\/schema\\\/person\\\/f1be8186602d3ebf417cf58baf125f24\",\"name\":\"Arjun Makadiya\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d1792fe07de4cbcd8b55a0a55e79e3a67f4df3ab63af6b0738833c83cac0eab3?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d1792fe07de4cbcd8b55a0a55e79e3a67f4df3ab63af6b0738833c83cac0eab3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d1792fe07de4cbcd8b55a0a55e79e3a67f4df3ab63af6b0738833c83cac0eab3?s=96&d=mm&r=g\",\"caption\":\"Arjun Makadiya\"},\"description\":\"Arjun Makadiya is a Junior Magento Developer at Cynoifotech. He is passionate about technology. Apart from work he likes to play cricket.\",\"url\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/author\\\/arjun-makadiya\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to add a custom tab myAccount section in Magento 2 - cynoinfotech","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cynoinfotech.com\/blog\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\/","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cynoinfotech.com\/blog\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\/#article","isPartOf":{"@id":"https:\/\/cynoinfotech.com\/blog\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\/"},"author":{"name":"Arjun Makadiya","@id":"https:\/\/cynoinfotech.com\/blog\/#\/schema\/person\/f1be8186602d3ebf417cf58baf125f24"},"headline":"How to add a custom tab myAccount section in Magento 2","datePublished":"2022-07-23T10:56:40+00:00","dateModified":"2026-04-16T13:32:11+00:00","mainEntityOfPage":{"@id":"https:\/\/cynoinfotech.com\/blog\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\/"},"wordCount":225,"publisher":{"@id":"https:\/\/cynoinfotech.com\/blog\/#organization"},"articleSection":["Magento blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/cynoinfotech.com\/blog\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\/","url":"https:\/\/cynoinfotech.com\/blog\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\/","name":"How to add a custom tab myAccount section in Magento 2 - cynoinfotech","isPartOf":{"@id":"https:\/\/cynoinfotech.com\/blog\/#website"},"datePublished":"2022-07-23T10:56:40+00:00","dateModified":"2026-04-16T13:32:11+00:00","breadcrumb":{"@id":"https:\/\/cynoinfotech.com\/blog\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cynoinfotech.com\/blog\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cynoinfotech.com\/blog\/how-to-add-a-custom-tab-in-my-account-section-in-magento-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cynoinfotech.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to add a custom tab myAccount section in Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/cynoinfotech.com\/blog\/#website","url":"https:\/\/cynoinfotech.com\/blog\/","name":"cynoinfotech","description":"web design &amp; development","publisher":{"@id":"https:\/\/cynoinfotech.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cynoinfotech.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cynoinfotech.com\/blog\/#organization","name":"Cynoinfotech","url":"https:\/\/cynoinfotech.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cynoinfotech.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.cynoinfotech.com\/wp-content\/uploads\/2017\/11\/final-logo-ci.png","contentUrl":"https:\/\/www.cynoinfotech.com\/wp-content\/uploads\/2017\/11\/final-logo-ci.png","width":240,"height":70,"caption":"Cynoinfotech"},"image":{"@id":"https:\/\/cynoinfotech.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/cynoinfotech\/","https:\/\/x.com\/cynoinfotech"]},{"@type":"Person","@id":"https:\/\/cynoinfotech.com\/blog\/#\/schema\/person\/f1be8186602d3ebf417cf58baf125f24","name":"Arjun Makadiya","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d1792fe07de4cbcd8b55a0a55e79e3a67f4df3ab63af6b0738833c83cac0eab3?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d1792fe07de4cbcd8b55a0a55e79e3a67f4df3ab63af6b0738833c83cac0eab3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d1792fe07de4cbcd8b55a0a55e79e3a67f4df3ab63af6b0738833c83cac0eab3?s=96&d=mm&r=g","caption":"Arjun Makadiya"},"description":"Arjun Makadiya is a Junior Magento Developer at Cynoifotech. He is passionate about technology. Apart from work he likes to play cricket.","url":"https:\/\/cynoinfotech.com\/blog\/author\/arjun-makadiya\/"}]}},"_links":{"self":[{"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/3340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/users\/670"}],"replies":[{"embeddable":true,"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/comments?post=3340"}],"version-history":[{"count":4,"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/3340\/revisions"}],"predecessor-version":[{"id":3345,"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/3340\/revisions\/3345"}],"wp:attachment":[{"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/media?parent=3340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/categories?post=3340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/tags?post=3340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}