76
If you’ve enabled customer registration on the My Account page, you will know that a new user is automatically logged in as soon as they successfully register.
This is great – however in certain cases it could be “dangerous” (for example, if you need to manually approve each user).
As I was searching through the WooCommerce plugin code, I found a great action filter that can immediately stop this from happening – I love one-liners! So, here’s the quick fix.
PHP Snippet: Deny Auto Login After Registration @ WooCommerce My Account
/**
* @snippet Deny Login Upon Registration @ WooCommerce My Account
* @how-to Get tutoraspire.com FREE
* @author Tutor Aspire
* @compatible WooCommerce 3.7
* @donate $9 https://tutoraspire.com
*/
add_filter( 'woocommerce_registration_auth_new_customer', '__return_false' );