This snippet allows you to prevent WooCommerce Backend login for non-admins.. It will not increase your store’s security significantly, but it will help you to hide the default WordPress login page.
Careful: if you use this snippet, please be aware that you will also not be able to login through the EXAMPLE.com/wp-admin link anymore. During the installation of WooCommerce, you will have set a ‘My Account’ page. You can use that page to login. Once authenticated as administrator, you will be able to access WooCommerce’s backend normally.