How to remove Bank Account details from WooCommerce Thank You page?

If we want to remove the bank account details from WooCommerce Thank You page, we’ll need to remove the action of the gateway, which places those details in the first place. This action is called woocommerce_thankyou_bacs and is registered in the WC_Gateway_BACS gateway class. To remove the action we need to get the class itself, so we can match everything the action was added with (remove_action only removes the exact action added with add_action).

Here is the complete example:

As you can see we get the “bacs” gateway class, store it in the $gateway variable and use the same class to remove the Thank You page action.

Leave a Reply

Your email address will not be published. Required fields are marked *