Magento – How to remove Create an Account button on Success Page in Magento 2

checkoutmagento2order-success-pagexml

I want to remove Create An Account button with "You can track your order status by creating an account." text on success page in Magento 2.
I have removed checkout.registration block from checkout_onepage_success.xml but it is still showing.

<referenceContainer name="content">
       <block class="Magento\Checkout\Block\Onepage\Success" name="checkout.success" template="success.phtml" cacheable="false"/>
       <!--<block class="Magento\Checkout\Block\Registration" name="checkout.registration" template="registration.phtml" cacheable="false"/>-->
</referenceContainer>

Can anyone help? Thanks in advance. 🙂

Best Answer

In your custom theme add the XML file below:

app/design/THEME/NAME/Magento_Checkout/frontend/layout/checkout_onepage_success.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">
    <referenceBlock name="checkout.registration" remove="true"/>
</page>
Related Topic