Question

I am needing to remove the main page title "Create New Customer Account" from the registration page.

I see everywhere that I need to add the line below somewhere but where?

<referenceBlock name="page.main.title" remove="true" />

Essentially I'd like to remove the following div from the page.

    <h1 class="page-title">
        <span class="base" data-ui-id="page-title-wrapper">Create New Customer Account</span>    </h1>
    </div>

Is this possible?

Was it helpful?

Solution

You can remove page title from layout file i.e customer_account_create.xml

Theme level:

create

app/design/frontend/{Package}/{my-theme}/Magento_Customer/layout/customer_account_create.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="page.main.title" remove="true" />
    </body>
</page>

Module level:

create:

app/code/{Vendor}/{Module}/view/frontend/layout/customer_account_create.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="page.main.title" remove="true" />
    </body>
</page>

OTHER TIPS

You need to override layout file in your custom theme with below code

app/design/frontend/Vendor/yourtheme/Magento_Customer/layout/customer_account_create.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="page.main.title" remove="true" />
    </body>
</page>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top