How can I add the Logout link in Customer My Account using the authorization-link in the body of ../Magento_Customer/layout/customer_account.xml?

I want to add this block:

to customer_account.xml to show logout link in my account, in main column of this view, the bottom of all

2 Answers 2


you can try this to add a tab in the customer account:

        <block class="Magento\Customer\Block\Account\SortLinkInterface" name="name of the block">
                <argument name="path" xsi:type="string">your path eg: abc/abc</argument>
                <argument name="label" xsi:type="string" translate="true">name of the tab</argument>
                <argument name="sortOrder" xsi:type="number">52</argument>

You can add the Logout link by adding below block in your customer_account.xml file after all links.

<referenceBlock name="customer_account_navigation">
    <block class="Magento\Framework\View\Element\Html\Link\Current" name="demo-link">
            <argument name="path" xsi:type="string">customer/account/logout</argument>
            <argument name="label" xsi:type="string">LogOut</argument>
            <argument name="sortOrder" xsi:type="number">1000</argument>

Hope it helps!!!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.