Remove create an account link in Magento 2

0
5802
Remove create an account link in Magento 2
Remove create an account link in Magento 2

Wondering how to remove create an account link in Magento 2? I will show you how to do that in this article.

Remove create an account link in Magento 2

There are two ways you can try:

  • Remove from layout.
  • Use CSS to hide the create an account link.

Either way, you will have to create either a module or a theme.

Method 1: Remove from layout

If you extend from Luma Theme, update the layout file app/design/frontend/Vendor/Theme/Magento_Theme/layout/default.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body> 
            <referenceBlock name="register-link" remove="true" />           <!--for Create Account Link-->
    </body>
</page>

Method 2: Use CSS to hide register account link

If you use LESS, add this:

.header.panel  {
    > .header.links {
        > .authorization-link {
            &:after {
                display: none;
            }
        }
    }
}

If you use CSS, add this:

.header.panel > .header.links > .authorization-link:after {
    display: none;
}

Well, LESS is a superset of CSS, so you can use both in the LESS file.

Conclusion

It’s done, I have shown you how to remove create an account link in Magento 2. You will see the result after refresh the page.

Have fun ~