Clean Woocommerce Spam Users at once

It happens that a woocommerce site has so many spam users. Now its tough to identify which user has order placed and which is spam users. To delete or clean spam users that doesn’t have any order placed, just create a php file and place it in your wordpress installation. And after that access that file in your browser. Before you run that scricpt , you create a full backup of your database. Place the below code in your PHP file.